1
0
Fork 0
mirror of https://github.com/dilllxd/gitfolio.git synced 2024-08-14 22:28:09 +00:00
gitfolio/update.js

36 lines
846 B
JavaScript
Raw Normal View History

2020-01-12 09:38:32 +00:00
const { getConfig } = require("./utils");
const { updateHTML } = require("./populate");
2019-12-11 17:10:27 +00:00
async function updateCommand() {
2020-01-12 09:38:32 +00:00
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;
}
2020-01-11 16:48:56 +00:00
2020-01-12 09:38:32 +00:00
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,
2020-01-14 12:08:00 +00:00
facebook: data[0].facebook,
2020-01-12 09:38:32 +00:00
instagram: data[0].instagram,
2020-01-12 10:25:54 +00:00
keybase: data[0].keybase,
2020-01-12 09:38:32 +00:00
reddit: data[0].reddit,
telegram: data[0].telegram,
twitter: data[0].twitter
};
updateHTML(username, opts);
}
module.exports = {
2020-01-12 09:38:32 +00:00
updateCommand
2019-12-11 17:10:27 +00:00
};