2019-08-12 04:10:00 +00:00
|
|
|
const { getConfig } = require("./utils");
|
|
|
|
const { updateHTML } = require("./populate");
|
2019-05-12 13:44:03 +00:00
|
|
|
|
2019-05-23 05:00:49 +00:00
|
|
|
async function updateCommand() {
|
2019-08-12 04:10:00 +00:00
|
|
|
const data = await getConfig();
|
|
|
|
var username = data[0].username;
|
|
|
|
var sort = data[0].sort;
|
|
|
|
var order = data[0].order;
|
|
|
|
var includeFork = data[0].includeFork;
|
|
|
|
var twitter = data[0].twitter;
|
|
|
|
var linkedin = data[0].linkedin;
|
|
|
|
var medium = data[0].medium;
|
|
|
|
var dribbble = data[0].dribbble;
|
|
|
|
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,
|
|
|
|
twitter,
|
|
|
|
linkedin,
|
|
|
|
medium,
|
|
|
|
dribbble
|
|
|
|
);
|
2019-05-23 05:00:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2019-08-12 04:10:00 +00:00
|
|
|
updateCommand
|
2019-05-23 05:00:49 +00:00
|
|
|
};
|