1
0
Fork 0
mirror of https://github.com/dilllxd/gitfolio.git synced 2024-08-14 22:28:09 +00:00
gitfolio/update.js
imfunny 5ff9146ff5
fixed #35
so umm looks like when you used update it would clear out config.json file, resaon being i was updating the html with only one argument and it needed 4 lol mb
2019-05-20 19:46:32 +05:30

16 lines
No EOL
600 B
JavaScript

const fs = require('fs');
const {updateHTML} = require('./populate');
fs.readFile("./dist/config.json", function (err , data) {
if (err) throw err;
data = JSON.parse(data);
var username = data[0].username;
var sort = data[0].sort;
var order = data[0].order;
var includeFork = data[0].includeFork;
if(username == null || sort == null || order == null || includeFork == null){
console.log("username not found in config.json, please run build command before using update");
return;
}
updateHTML(username, sort, order, includeFork);
});