diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-07-01 12:20:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-01 12:20:40 +0800 |
commit | d4e400e5e5a7ba501f210b722f6ccf97be9e6c17 (patch) | |
tree | 85b9c12d88db37dd586a50c9ebfdebc5d980da1e /development/genStates.js | |
parent | 70cf24617bf6adabf5ba012ba1af261df6e79fb3 (diff) | |
parent | 0f16155abfbe3b45677503846aa04cb5c7ef47bf (diff) | |
download | tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.tar tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.tar.gz tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.tar.bz2 tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.tar.lz tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.tar.xz tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.tar.zst tangerine-wallet-browser-d4e400e5e5a7ba501f210b722f6ccf97be9e6c17.zip |
Merge pull request #378 from MetaMask/UiDev
Ui dev
Diffstat (limited to 'development/genStates.js')
-rw-r--r-- | development/genStates.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/development/genStates.js b/development/genStates.js new file mode 100644 index 000000000..39a672ee0 --- /dev/null +++ b/development/genStates.js @@ -0,0 +1,18 @@ +const fs = require('fs') +const path = require('path') + +const statesPath = path.join(__dirname, 'states') +const stateNames = fs.readdirSync(statesPath) + +const states = stateNames.reduce((result, stateFileName) => { + const statePath = path.join(__dirname, 'states', stateFileName) + const stateFile = fs.readFileSync(statePath).toString() + const state = JSON.parse(stateFile) + result[stateFileName.split('.')[0].replace(/-/g, ' ', 'g')] = state + return result +}, {}) + +const result = `module.exports = ${JSON.stringify(states)}` + +const statesJsonPath = path.join(__dirname, 'states.js') +fs.writeFileSync(statesJsonPath, result) |