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

Improved username checking, fix for config.json writing blank (#37)

* added better checking for username flag

* added fs.writeFileSync, as process would sometimes end before async write finished

* removed process.exit(0), which would exec before the config was written

* some formatting fixes to align w/ upstream

* added trim() to check for whitespace

* fixed selectors in index.css (no #projects id exists)
This commit is contained in:
Benjamin Liden 2019-05-20 21:37:08 -04:00 committed by imfunny
parent d84d6fd2b4
commit 52014e1cd5
3 changed files with 4 additions and 4 deletions

View file

@ -384,10 +384,10 @@ body{
#work {
margin:0px;
}
#projects {
.projects {
columns:1;
}
#projects section {
.projects section {
width:88%;
}
#blogs {

View file

@ -81,7 +81,7 @@ async function populateConfig(sort, order, includeFork) {
populateCSS();
if (program.name) {
if (typeof program.name === 'string' && program.name.trim() !== '') {
let sort = program.sort ? program.sort : 'created';
let order = "asc";
let includeFork = false;

View file

@ -115,12 +115,12 @@ module.exports.updateHTML = (username, sort, order, includeFork) => {
data[0].userimg = user.avatar_url;
fs.writeFile('./dist/config.json', JSON.stringify(data, null, ' '), function (err) {
if (err) throw err;
console.log("Config file updated.");
});
});
fs.writeFile('dist/index.html', '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
if (error) throw error;
console.log("Build Complete");
process.exit(0)
});
} catch (error) {
console.log(error);