mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
36 lines
868 B
JavaScript
36 lines
868 B
JavaScript
const { getConfig } = require("./utils");
|
|
const { updateHTML } = require("./populate");
|
|
|
|
async function updateCommand() {
|
|
const data = await getConfig();
|
|
const { username } = data[0];
|
|
if (username === null) {
|
|
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,
|
|
codepen: data[0].codepen,
|
|
dev: data[0].dev,
|
|
dribbble: data[0].dribbble,
|
|
email: data[0].email,
|
|
facebook: data[0].facebook,
|
|
instagram: data[0].instagram,
|
|
keybase: data[0].keybase,
|
|
reddit: data[0].reddit,
|
|
telegram: data[0].telegram,
|
|
twitter: data[0].twitter,
|
|
xda: data[0].xda
|
|
};
|
|
updateHTML(username, opts);
|
|
}
|
|
|
|
module.exports = {
|
|
updateCommand
|
|
};
|