2019-12-11 17:10:27 +00:00
|
|
|
const { getConfig } = require("./utils");
|
|
|
|
const { updateHTML } = require("./populate");
|
2019-11-17 02:27:32 +00:00
|
|
|
|
2019-12-11 17:10:27 +00:00
|
|
|
async function updateCommand() {
|
2019-11-17 02:27:32 +00:00
|
|
|
const data = await getConfig();
|
|
|
|
var username = data[0].username;
|
2019-12-11 17:10:27 +00:00
|
|
|
if (username == null) {
|
2019-11-17 02:27:32 +00:00
|
|
|
console.log(
|
|
|
|
"username not found in config.json, please run build command before using update"
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const opts = {
|
|
|
|
sort: data[0].sort,
|
|
|
|
order: data[0].order,
|
|
|
|
includeFork: data[0].includeFork,
|
|
|
|
types: data[0].types,
|
2019-12-08 17:14:52 +00:00
|
|
|
codepen: data[0].codepen,
|
|
|
|
dev: data[0].dev,
|
2019-12-07 16:18:12 +00:00
|
|
|
dribbble: data[0].dribbble,
|
2019-12-08 16:23:21 +00:00
|
|
|
email: data[0].email,
|
2019-12-08 17:14:52 +00:00
|
|
|
instagram: data[0].instagram,
|
2019-12-15 13:15:08 +00:00
|
|
|
reddit: data[0].reddit,
|
2019-12-14 16:16:09 +00:00
|
|
|
telegram: data[0].telegram,
|
2019-12-08 16:23:21 +00:00
|
|
|
twitter: data[0].twitter
|
2019-11-17 02:27:32 +00:00
|
|
|
};
|
|
|
|
updateHTML(username, opts);
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
updateCommand
|
2019-12-11 17:10:27 +00:00
|
|
|
};
|