Skip to content

Commit

Permalink
Fix fs path issue on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ilufang committed Dec 6, 2016
1 parent 61c40c8 commit f50e4b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data-helper.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
log("Loaded from directory.");
}
function loadFromJson() {
var obj = JSON.parse(fs.readFileSync('data/courses.json'));
var obj = JSON.parse(fs.readFileSync(__dirname+'/data/courses.json'));
catalog = Catalog.fromStorage(new ioutils.json_io(obj));
log("Loaded from JSON file.");
}
Expand All @@ -36,7 +36,7 @@
function writeToJson() {
var io = new ioutils.json_io();
catalog.save(io);
fs.writeFileSync('data/courses.json', JSON.stringify(io.data));
fs.writeFileSync(__dirname+'/data/courses.json', JSON.stringify(io.data));
log("Saved to JSON file.");
}
function goback() {
Expand Down

0 comments on commit f50e4b1

Please sign in to comment.