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

fixed issue #12

This commit is contained in:
imfunny 2019-05-13 09:40:24 +05:30 committed by GitHub
parent 24c982c55e
commit eea39f7b56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 15 deletions

View file

@ -18,13 +18,13 @@ function populateCSS(){
if (err) throw err; if (err) throw err;
fs.appendFile('index.css', dark, function (err) { fs.appendFile('index.css', dark, function (err) {
if (err) throw err; if (err) throw err;
fs.readFile("config.json", function (err , data) { });
if (err) throw err; fs.readFile("config.json", function (err , data) {
data = JSON.parse(data); if (err) throw err;
data[0].theme = "dark"; data = JSON.parse(data);
fs.writeFile('config.json', JSON.stringify(data, null, ' '), function(err){ data[0].theme = "dark";
if (err) throw err; fs.writeFile('config.json', JSON.stringify(data, null, ' '), function(err){
}); if (err) throw err;
}); });
}); });
}); });
@ -33,13 +33,13 @@ function populateCSS(){
if (err) throw err; if (err) throw err;
fs.appendFile('index.css', light, function (err) { fs.appendFile('index.css', light, function (err) {
if (err) throw err; if (err) throw err;
fs.readFile("config.json", function (err , data) { });
if (err) throw err; fs.readFile("config.json", function (error , data) {
data = JSON.parse(data); if (error) throw err;
data[0].theme = "light"; data = JSON.parse(data);
fs.writeFile('config.json', JSON.stringify(data, null, ' '), function(err){ data[0].theme = "light";
if (err) throw err; fs.writeFile('config.json', JSON.stringify(data, null, ' '), function(error){
}); if (error) throw err;
}); });
}); });
}); });

View file

@ -3,7 +3,7 @@
"username": null, "username": null,
"name": null, "name": null,
"userimg": null, "userimg": null,
"background": null, "background": "https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450",
"theme": "light" "theme": "light"
} }
] ]