Skip to content

Commit 4fd3c54

Browse files
committed
Fix: wrong directory path
1 parent fd76781 commit 4fd3c54

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ Users appreciate release notes as you update your extension.
2121

2222
Initial release
2323

24+
### 0.5.1
25+
26+
Fix: wrong directory path
27+

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "csak-ext-timer",
33
"displayName": "csak-ext-timer",
44
"description": "If you want to know what time was spent for projects",
5-
"version": "0.5.0",
5+
"version": "0.5.1",
66
"publisher": "csakaszamok",
77
"engines": {
88
"vscode": "^1.18.0"

src/extension.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,22 @@ class WordCounterController {
185185
console.log('Start at', this.starttime.toLocaleTimeString());
186186
this._wordCounter = wordCounter;
187187

188+
189+
//console.log(vscode.workspace.workspaceFolders.length);
190+
188191
if (!vscode.window.activeTextEditor || !vscode.window.activeTextEditor.document) {
189192
return;
190193
}
191194
//set logfile path
192-
var s = path.normalize(vscode.window.activeTextEditor.document.fileName);
193-
var p = path.dirname(s);
195+
// var s = path.normalize(vscode.window.activeTextEditor.document.fileName);
196+
var p = vscode.workspace.workspaceFolders[0].uri.fsPath
194197
var folderpath = p.split('\\').pop();
195198
if (folderpath != '.vscode') {
196199
folderpath = p + '/.vscode'
197200
} else {
198201
folderpath = p;
199202
}
200-
if (!fs.existsSync(folderpath)){
203+
if (!fs.existsSync(folderpath)) {
201204
fs.mkdirSync(folderpath);
202205
}
203206
this.logfile = folderpath + '/csak-timelog.json';
@@ -255,7 +258,7 @@ class WordCounterController {
255258
this.startTimer();
256259
}
257260
//this._wordCounter.updateWordCount(this.getElapsedTime());
258-
261+
259262
}
260263
}
261264

0 commit comments

Comments
 (0)