mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Move tos hash logic to build phase. Create dynamic global variables based on build.
This commit is contained in:
parent
89780bd22a
commit
ed03b89e26
@ -2,7 +2,8 @@ const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask'
|
||||
const TESTNET_RPC_URL = 'https://morden.infura.io/metamask'
|
||||
const DEFAULT_RPC_URL = TESTNET_RPC_URL
|
||||
|
||||
global.METAMASK_DEBUG = false
|
||||
global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
|
||||
global.TOS_HASH = 'GULP_TOS_HASH'
|
||||
|
||||
module.exports = {
|
||||
network: {
|
||||
|
@ -18,8 +18,15 @@ var path = require('path')
|
||||
var manifest = require('./app/manifest.json')
|
||||
var gulpif = require('gulp-if')
|
||||
var replace = require('gulp-replace')
|
||||
var disclaimer = fs.readFileSync(path.join(__dirname, 'USER_AGREEMENT.md')).toString()
|
||||
var crypto = require('crypto')
|
||||
var hash = crypto.createHash('sha256')
|
||||
|
||||
hash.update(disclaimer)
|
||||
var tosHash = hash.digest('hex')
|
||||
|
||||
var disableLiveReload = gutil.env.disableLiveReload
|
||||
var debug = gutil.env.debug
|
||||
|
||||
// browser reload
|
||||
|
||||
@ -237,6 +244,8 @@ function bundleTask(opts) {
|
||||
.on('error', gutil.log.bind(gutil, 'Browserify Error'))
|
||||
.pipe(source(opts.filename))
|
||||
.pipe(brfs())
|
||||
.pipe(replace('GULP_TOS_HASH', tosHash))
|
||||
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debug))
|
||||
// optional, remove if you don't need to buffer file contents
|
||||
.pipe(buffer())
|
||||
// optional, remove if you dont want sourcemaps
|
||||
|
@ -77,7 +77,6 @@
|
||||
"redux-thunk": "^1.0.2",
|
||||
"request-promise": "^4.1.1",
|
||||
"sandwich-expando": "^1.0.5",
|
||||
"string-hash": "^1.1.0",
|
||||
"textarea-caret": "^3.0.1",
|
||||
"three.js": "^0.73.2",
|
||||
"through2": "^2.0.1",
|
||||
|
@ -4,7 +4,7 @@ const thunkMiddleware = require('redux-thunk')
|
||||
const rootReducer = require('./reducers')
|
||||
const createLogger = require('redux-logger')
|
||||
|
||||
global.METAMASK_DEBUG = false
|
||||
global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
|
||||
|
||||
module.exports = configureStore
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user