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:
parent
d84d6fd2b4
commit
52014e1cd5
3 changed files with 4 additions and 4 deletions
|
@ -384,10 +384,10 @@ body{
|
||||||
#work {
|
#work {
|
||||||
margin:0px;
|
margin:0px;
|
||||||
}
|
}
|
||||||
#projects {
|
.projects {
|
||||||
columns:1;
|
columns:1;
|
||||||
}
|
}
|
||||||
#projects section {
|
.projects section {
|
||||||
width:88%;
|
width:88%;
|
||||||
}
|
}
|
||||||
#blogs {
|
#blogs {
|
||||||
|
|
2
build.js
2
build.js
|
@ -81,7 +81,7 @@ async function populateConfig(sort, order, includeFork) {
|
||||||
|
|
||||||
populateCSS();
|
populateCSS();
|
||||||
|
|
||||||
if (program.name) {
|
if (typeof program.name === 'string' && program.name.trim() !== '') {
|
||||||
let sort = program.sort ? program.sort : 'created';
|
let sort = program.sort ? program.sort : 'created';
|
||||||
let order = "asc";
|
let order = "asc";
|
||||||
let includeFork = false;
|
let includeFork = false;
|
||||||
|
|
|
@ -115,12 +115,12 @@ module.exports.updateHTML = (username, sort, order, includeFork) => {
|
||||||
data[0].userimg = user.avatar_url;
|
data[0].userimg = user.avatar_url;
|
||||||
fs.writeFile('./dist/config.json', JSON.stringify(data, null, ' '), function (err) {
|
fs.writeFile('./dist/config.json', JSON.stringify(data, null, ' '), function (err) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
console.log("Config file updated.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
fs.writeFile('dist/index.html', '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
|
fs.writeFile('dist/index.html', '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
console.log("Build Complete");
|
console.log("Build Complete");
|
||||||
process.exit(0)
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
Loading…
Reference in a new issue