diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-02-10 09:47:51 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-02-10 09:47:51 +0800 |
commit | 1d0fcf129c8bd7174aecccca3acf54ee83215d19 (patch) | |
tree | f6423a24d299478f8e174e319c7c9c76bd804936 /notices/notice-generator.js | |
parent | 2f6bf1c074fc49fd0354380c24e07eb9aa2a5ec2 (diff) | |
download | tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.tar tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.tar.gz tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.tar.bz2 tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.tar.lz tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.tar.xz tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.tar.zst tangerine-wallet-browser-1d0fcf129c8bd7174aecccca3acf54ee83215d19.zip |
Fix bugs with notice. Add disclaimer notice.
Diffstat (limited to 'notices/notice-generator.js')
-rw-r--r-- | notices/notice-generator.js | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/notices/notice-generator.js b/notices/notice-generator.js index a691bca15..7c41c5676 100644 --- a/notices/notice-generator.js +++ b/notices/notice-generator.js @@ -4,8 +4,8 @@ var prompt = require('prompt') var open = require('open') var extend = require('extend') var notices = require('./notices.json') +var id = Number(require('./notice-nonce.json')) -var id = 0 var date = new Date().toDateString() var notice = { @@ -13,24 +13,21 @@ var notice = { date: date, } -fsp.readdir('notices/archive') - .then((files) => { - files.forEach(file => { id ++ }) - Promise.resolve() - }).then(() => { - fsp.writeFile(`notices/archive/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.') - .then(() => { - open(`notices/archive/notice_${id}.md`) - prompt.start() - prompt.get(['title'], (err, result) => { - notice.title = result.title - fsp.readFile(`notices/archive/notice_${id}.md`) - .then((body) => { - notice.body = body.toString() - notice.id = id - notices.push(notice) - return fsp.writeFile(`notices/notices.json`, JSON.stringify(notices)) - }) +fsp.writeFile(`notices/archive/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.') + .then(() => { + open(`notices/archive/notice_${id}.md`) + prompt.start() + prompt.get(['title'], (err, result) => { + notice.title = result.title + fsp.readFile(`notices/archive/notice_${id}.md`) + .then((body) => { + notice.body = body.toString() + notice.id = id + notices.push(notice) + return fsp.writeFile(`notices/notices.json`, JSON.stringify(notices)) + }).then((completion) => { + id += 1 + return fsp.writeFile(`notices/notice-nonce.json`, id) }) - }) + }) }) |