postinstall script
This commit is contained in:
+2
-1
@@ -18,7 +18,8 @@
|
||||
"supertest": "^4.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
"test": "jest",
|
||||
"install": "postinstall.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
const fs = require('fs');
|
||||
const ncp = require('ncp').ncp;
|
||||
|
||||
const pad0 = n => ('0'+n).substr(-2);
|
||||
|
||||
const datetime = new Date();
|
||||
const dir = `./data/${datetime.getFullYear()}/${pad0(datetime.getMonth())}/${pad0(datetime.getDay())}/`;
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, {recursive: true});
|
||||
}
|
||||
|
||||
ncp('./sample_data/',dir, function(err){
|
||||
if(err)
|
||||
console.error(err);
|
||||
else
|
||||
console.log('done');
|
||||
});
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 898 KiB |
@@ -0,0 +1,6 @@
|
||||
# Welcome to your new blog
|
||||
|
||||
## If you see this page, that means it's working
|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user