aboutsummaryrefslogtreecommitdiffstats
path: root/development/notice-generator.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-12-20 05:35:43 +0800
committerDan Finlay <dan@danfinlay.com>2016-12-20 05:37:27 +0800
commit77d2deb17654b87dfd306b7f7cef335b1b511a8f (patch)
tree7476af4926a4e27999086ee570e46c4f74621b84 /development/notice-generator.js
parent1b6ee56cac34cd3544fd375cad342eb8240ae8aa (diff)
parent6ce0bc4b11ccb7ffae4f58980db0301dc418c9c0 (diff)
downloadtangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.gz
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.bz2
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.lz
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.xz
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.zst
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.zip
Merged master into dev
Diffstat (limited to 'development/notice-generator.js')
-rw-r--r--development/notice-generator.js36
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))
+ })
+ })
+ })
+ })