diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-12-08 06:34:15 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-12-17 02:44:52 +0800 |
commit | 8819475a2ed2ee7c34e983ebb5ab12661be1a961 (patch) | |
tree | 6d410c35aca5bae541481d96cb492597d7470826 /development/notice-generator.js | |
parent | d5569781ba2668df78ab7cf0f20ac93f84cafadb (diff) | |
download | tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.tar tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.tar.gz tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.tar.bz2 tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.tar.lz tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.tar.xz tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.tar.zst tangerine-wallet-browser-8819475a2ed2ee7c34e983ebb5ab12661be1a961.zip |
Add ability to show notices to user & get confirmation.
Implement generation of markdown for notice files.
Create npm command. Enhance notice generation.
Add test files to test multiple notices.
Add basic markdown support to notices.
Interval checks for updates.
Add extensionizer and linker
Add terms and conditions state file
Add link support to disclaimer.
Changelog addition.
Diffstat (limited to 'development/notice-generator.js')
-rw-r--r-- | development/notice-generator.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/development/notice-generator.js b/development/notice-generator.js new file mode 100644 index 000000000..08b0c9843 --- /dev/null +++ b/development/notice-generator.js @@ -0,0 +1,36 @@ +var fsp = require('fs-promise') +var path = require('path') +var prompt = require('prompt') +var open = require('open') +var extend = require('extend') +var notices = require('./notices.json') + +var id = 0 +var date = new Date().toDateString() + +var notice = { + read: false, + date: date, +} + +fsp.readdir('notices') + .then((files) => { + files.forEach(file => { id ++ }) + Promise.resolve() + }).then(() => { + fsp.writeFile(`notices/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.') + .then(() => { + open(`notices/notice_${id}.md`) + prompt.start() + prompt.get(['title'], (err, result) => { + notice.title = result.title + fsp.readFile(`notices/notice_${id}.md`) + .then((body) => { + notice.body = body.toString() + notice.id = id + notices.push(notice) + return fsp.writeFile(`development/notices.json`, JSON.stringify(notices)) + }) + }) + }) + }) |