Skip to content

Commit

Permalink
Merge pull request #26 from badsyntax/fix-24-git-bash-windows
Browse files Browse the repository at this point in the history
Add support for git bash on Windows. Fixes #24
  • Loading branch information
badsyntax authored Nov 5, 2019
2 parents 5d3e07c + 19ad8ab commit e7dc9d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
},
"gradle.enableTasksExplorer": {
"type": "boolean",
"default": false,
"default": true,
"description": "Enable an explorer view for gradle tasks"
},
"gradle.tasksArgs": {
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ export function getIsAutoDetectionEnabled(folder: WorkspaceFolder): boolean {
return (
workspace
.getConfiguration('gradle', folder.uri)
.get<AutoDetect>('autoDetect') === 'on'
.get<AutoDetect>('autoDetect', 'on') === 'on'
);
}

export function getTasksArgs(folder: WorkspaceFolder): string {
return workspace
.getConfiguration('gradle', folder.uri)
.get<string>('tasksArgs', '');
.get<string>('tasksArgs', '--all');
}

export function getIsTasksExplorerEnabled(): boolean {
Expand Down
6 changes: 3 additions & 3 deletions src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ async function getGradleWrapperCommandFromFolder(
platform === 'win32' &&
(await exists(path.join(folder.uri.fsPath!, 'gradlew.bat')))
) {
return path.join(folder.uri.fsPath!, 'gradlew.bat');
return '.\\gradlew.bat';
} else if (
(platform === 'linux' || platform === 'darwin') &&
(await exists(path.join(folder.uri.fsPath!, 'gradlew')))
) {
return path.join(folder.uri.fsPath!, 'gradlew');
return './gradlew';
} else {
throw new Error('Gradle wrapper executable not found');
}
Expand Down Expand Up @@ -252,7 +252,7 @@ export function createTask(
if (customBuildFile) {
args.push('--build-file', customBuildFile);
}
return `${command} ${args.join(' ')}`;
return `"${command}" ${args.join(' ')}`;
}

function getRelativePath(
Expand Down

0 comments on commit e7dc9d1

Please sign in to comment.