Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abudayah committed Jan 20, 2018
1 parent 7e95389 commit cb662dd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
11 changes: 11 additions & 0 deletions contrTimer.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ var ContrTimer = function () {
});
});
}
}, {
key: 'createTimeLogFile',
value: function createTimeLogFile() {
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.timerLogFilePath;

return new Promise(function (resolve, reject) {
fs.writeFile(path, '', function (error) {
if (error) reject(error);else resolve(true);
});
});
}
}, {
key: 'prepareUserBlock',
value: function prepareUserBlock(data) {
Expand Down
9 changes: 9 additions & 0 deletions src/contrTimer.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ class ContrTimer {
});
}

createTimeLogFile(path = this.timerLogFilePath){
return new Promise((resolve, reject) => {
fs.writeFile(path, '', (error) => {
if (error) reject(error);
else resolve(true);
});
});
}

prepareUserBlock(data){
this.timerlog = (data) ? JSON.parse(data) : false;
this.userBlock = this.getUser();
Expand Down
4 changes: 2 additions & 2 deletions timerlog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"[email protected]": {
"name": "Anas Abudayah",
"email": "[email protected]",
"total_time": 6335,
"total_time": 6395,
"branches": {
"master": 125,
"master": 185,
"code-revamp": 4110,
"supportOldNodeVersions": 2100
}
Expand Down

0 comments on commit cb662dd

Please sign in to comment.