modification of notices.
This commit is contained in:
parent
3afa3592fe
commit
afb60b9061
11
README.md
11
README.md
|
@ -153,3 +153,14 @@ gource \
|
||||||
--output-framerate 30 \
|
--output-framerate 30 \
|
||||||
| ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K metamask-dev-history.mp4
|
| ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K metamask-dev-history.mp4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Generating Notices
|
||||||
|
|
||||||
|
To add a notice:
|
||||||
|
```
|
||||||
|
npm run generateNotice
|
||||||
|
```
|
||||||
|
To delete a notice:
|
||||||
|
```
|
||||||
|
npm run deleteNotice
|
||||||
|
```
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
[{"read":false,"date":"Fri Dec 16 2016","title":"Ending Morden Support","body":"Due to [recent events](https://blog.ethereum.org/2016/11/20/from-morden-to-ropsten/), MetaMask is now deprecating support for the Morden Test Network.\n\nUsers will still be able to access Morden through a locally hosted node, but we will no longer be providing hosted access to this network through [Infura](http://infura.io/).\n\nPlease use the new Ropsten Network as your new default test network.\n\nYou can fund your Ropsten account using the buy button on your account page.\n\nBest wishes!\nThe MetaMask Team\n\n","id":0}]
|
|
|
@ -11,7 +11,7 @@
|
||||||
"network": null,
|
"network": null,
|
||||||
"accounts": {},
|
"accounts": {},
|
||||||
"transactions": [],
|
"transactions": [],
|
||||||
"isDisclaimerConfirmed": true,
|
"isDisclaimerConfirmed": false,
|
||||||
"unconfMsgs": {},
|
"unconfMsgs": {},
|
||||||
"messages": [],
|
"messages": [],
|
||||||
"shapeShiftTxList": [],
|
"shapeShiftTxList": [],
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
var fs = require('fs')
|
||||||
|
var path = require('path')
|
||||||
|
var prompt = require('prompt')
|
||||||
|
var open = require('open')
|
||||||
|
var extend = require('extend')
|
||||||
|
var notices = require('./notices.json')
|
||||||
|
|
||||||
|
|
||||||
|
console.log('List of Notices')
|
||||||
|
console.log(`ID \t DATE \t\t\t TITLE`)
|
||||||
|
notices.forEach((notice) => {
|
||||||
|
console.log(`${(' ' + notice.id).slice(-2)} \t ${notice.date} \t ${notice.title}`)
|
||||||
|
})
|
||||||
|
prompt.get(['id'], (error, res) => {
|
||||||
|
prompt.start()
|
||||||
|
if (error) {
|
||||||
|
console.log("Exiting...")
|
||||||
|
process.exit()
|
||||||
|
}
|
||||||
|
var index = notices.findIndex((notice) => { return notice.id == res.id})
|
||||||
|
if (index === -1) {
|
||||||
|
console.log('Notice not found. Exiting...')
|
||||||
|
}
|
||||||
|
notices.splice(index, 1)
|
||||||
|
fs.unlink(`notices/archive/notice_${res.id}.md`)
|
||||||
|
fs.writeFile(`notices/notices.json`, JSON.stringify(notices))
|
||||||
|
})
|
|
@ -13,23 +13,23 @@ var notice = {
|
||||||
date: date,
|
date: date,
|
||||||
}
|
}
|
||||||
|
|
||||||
fsp.readdir('notices')
|
fsp.readdir('notices/archive')
|
||||||
.then((files) => {
|
.then((files) => {
|
||||||
files.forEach(file => { id ++ })
|
files.forEach(file => { id ++ })
|
||||||
Promise.resolve()
|
Promise.resolve()
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
fsp.writeFile(`notices/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.')
|
fsp.writeFile(`notices/archive/notice_${id}.md`,'Message goes here. Please write out your notice and save before proceeding at the command line.')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
open(`notices/notice_${id}.md`)
|
open(`notices/archive/notice_${id}.md`)
|
||||||
prompt.start()
|
prompt.start()
|
||||||
prompt.get(['title'], (err, result) => {
|
prompt.get(['title'], (err, result) => {
|
||||||
notice.title = result.title
|
notice.title = result.title
|
||||||
fsp.readFile(`notices/notice_${id}.md`)
|
fsp.readFile(`notices/archive/notice_${id}.md`)
|
||||||
.then((body) => {
|
.then((body) => {
|
||||||
notice.body = body.toString()
|
notice.body = body.toString()
|
||||||
notice.id = id
|
notice.id = id
|
||||||
notices.push(notice)
|
notices.push(notice)
|
||||||
return fsp.writeFile(`development/notices.json`, JSON.stringify(notices))
|
return fsp.writeFile(`notices/notices.json`, JSON.stringify(notices))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
|
@ -0,0 +1 @@
|
||||||
|
[]
|
|
@ -20,7 +20,8 @@
|
||||||
"testem": "npm run buildMock && testem",
|
"testem": "npm run buildMock && testem",
|
||||||
"ci": "npm run buildMock && npm run buildCiUnits && testem ci -P 2",
|
"ci": "npm run buildMock && npm run buildCiUnits && testem ci -P 2",
|
||||||
"announce": "node development/announcer.js",
|
"announce": "node development/announcer.js",
|
||||||
"generateNotice": "node development/notice-generator.js"
|
"generateNotice": "node notices/notice-generator.js",
|
||||||
|
"deleteNotice": "node notices/notice-delete.js"
|
||||||
},
|
},
|
||||||
"browserify": {
|
"browserify": {
|
||||||
"transform": [
|
"transform": [
|
||||||
|
|
Loading…
Reference in New Issue