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;
|
2019-08-13 09:54:14 +00:00
|
|
|
if (username == null) {
|
2019-08-12 04:10:00 +00:00
|
|
|
console.log(
|
|
|
|
"username not found in config.json, please run build command before using update"
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
2019-08-13 09:54:14 +00:00
|
|
|
const opts = {
|
|
|
|
sort: data[0].sort,
|
|
|
|
order: data[0].order,
|
|
|
|
includeFork: data[0].includeFork,
|
|
|
|
types: data[0].types,
|
|
|
|
twitter: data[0].twitter,
|
|
|
|
linkedin: data[0].linkedin,
|
|
|
|
medium: data[0].medium,
|
|
|
|
dribbble: data[0].dribbble
|
|
|
|
};
|
|
|
|
updateHTML(username, opts);
|
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
|
|
|
};
|