aboutsummaryrefslogtreecommitdiffstats
path: root/development/notice-generator.js
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2016-12-22 06:31:07 +0800
committerGitHub <noreply@github.com>2016-12-22 06:31:07 +0800
commit6f7c23fd28ef37ae51478b735c1f5888c97bbaf5 (patch)
treeb927871ed00c33a66341a26de09f00cf006314b8 /development/notice-generator.js
parenta85c691b71d5142d2412000930328fbe9161760a (diff)
parent73cdf0bfd49470bad1f0da4d0d894278c87af54e (diff)
downloadtangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.tar
tangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.tar.gz
tangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.tar.bz2
tangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.tar.lz
tangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.tar.xz
tangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.tar.zst
tangerine-wallet-browser-6f7c23fd28ef37ae51478b735c1f5888c97bbaf5.zip
Merge branch 'dev' into TxManager
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))
+ })
+ })
+ })
+ })