Skip to content

Commit

Permalink
Prevent overwriting JSON file when loading the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
iliashad committed Sep 24, 2019
1 parent 4b29538 commit dca42fc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 47 deletions.
22 changes: 22 additions & 0 deletions extension.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "habitscript",
"displayName": "HabitScript",
"description": "Increase Your Productiviy by Tracking Your Coding Time",
"version": "1.0.48",
"version": "1.0.51",
"publisher": "iliashaddad",
"keywords": [
"track coding time",
Expand Down
44 changes: 0 additions & 44 deletions src/main.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/offline.js
Expand Up @@ -11,7 +11,7 @@ let file = getJSONFile();

export function createJsonFile(fileDuration) {
console.log("Creating JSON File...");
fs.exists(file, function(exists) {
let exists = fs.existsSync(file);
if (exists) {
let data = fs.readFileSync(file);

Expand All @@ -32,7 +32,7 @@ export function createJsonFile(fileDuration) {
console.log("The file has been saved!");
});
}
});

}

function checkAndAddFile(fileDuration) {
Expand Down

0 comments on commit dca42fc

Please sign in to comment.