aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-10-12 05:32:03 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-10-12 05:32:03 +0800
commited03b89e266ab25444d69f23e5f9f0070f0080d7 (patch)
tree97b51cb1bfff54be42218ec7bce83ce0a852c208 /gulpfile.js
parent89780bd22a87692f73f42f56b4774aba64986e9a (diff)
downloadtangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.tar
tangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.tar.gz
tangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.tar.bz2
tangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.tar.lz
tangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.tar.xz
tangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.tar.zst
tangerine-wallet-browser-ed03b89e266ab25444d69f23e5f9f0070f0080d7.zip
Move tos hash logic to build phase. Create dynamic global variables based on build.
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 9f1acbf67..26ad0c1f8 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -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