Skip to content

Commit

Permalink
Temporary workaround for urgent VSCode bug in v1.22 with a broken tas…
Browse files Browse the repository at this point in the history
…k runner for Windows OS // Resolve #97
  • Loading branch information
ivankravets committed Apr 9, 2018
1 parent 1ab5f8f commit 3648a05
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 0.14.1 (2018-04-09)

* Temporary workaround for urgent VSCode bug in v1.22 with a broken task runner for Windows OS (issue [#97](https://github.com/platformio/platformio-vscode-ide/issues/97))

## 0.14.0 (2018-03-14)

* Intial support for PIO Enterprise
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"vscode:package": "babel src --out-dir lib && vsce package"
},
"devDependencies": {
"@types/node": "^6.0.101",
"@types/node": "^7",
"babel-cli": "^6.24.1",
"babel-eslint": "^8.0.1",
"babel-plugin-transform-class-properties": "^6.24.1",
Expand Down
12 changes: 11 additions & 1 deletion src/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,24 @@ class TaskCreator {
}

create() {
let pioCmd = 'platformio';
if (IS_WINDOWS) {
pioCmd = 'platformio.exe';
process.env.PATH.split(path.delimiter).forEach(item => {
if (fs.isFileSync(path.join(item, pioCmd))) {
pioCmd = path.join(item, pioCmd);
return;
}
});
}
const task = new vscode.Task(
{
type: PIOTasksProvider.title,
args: this._args
},
this.name,
PIOTasksProvider.title,
new vscode.ProcessExecution(IS_WINDOWS ? 'platformio.exe' : 'platformio', this._args, {
new vscode.ProcessExecution(pioCmd, this._args, {
env: process.env
}),
'$platformio'
Expand Down

0 comments on commit 3648a05

Please sign in to comment.