Skip to content

Commit e7dc9d1

Browse files
authored
Merge pull request #26 from badsyntax/fix-24-git-bash-windows
Add support for git bash on Windows. Fixes #24
2 parents 5d3e07c + 19ad8ab commit e7dc9d1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
},
123123
"gradle.enableTasksExplorer": {
124124
"type": "boolean",
125-
"default": false,
125+
"default": true,
126126
"description": "Enable an explorer view for gradle tasks"
127127
},
128128
"gradle.tasksArgs": {

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export function getIsAutoDetectionEnabled(folder: WorkspaceFolder): boolean {
1212
return (
1313
workspace
1414
.getConfiguration('gradle', folder.uri)
15-
.get<AutoDetect>('autoDetect') === 'on'
15+
.get<AutoDetect>('autoDetect', 'on') === 'on'
1616
);
1717
}
1818

1919
export function getTasksArgs(folder: WorkspaceFolder): string {
2020
return workspace
2121
.getConfiguration('gradle', folder.uri)
22-
.get<string>('tasksArgs', '');
22+
.get<string>('tasksArgs', '--all');
2323
}
2424

2525
export function getIsTasksExplorerEnabled(): boolean {

src/tasks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ async function getGradleWrapperCommandFromFolder(
112112
platform === 'win32' &&
113113
(await exists(path.join(folder.uri.fsPath!, 'gradlew.bat')))
114114
) {
115-
return path.join(folder.uri.fsPath!, 'gradlew.bat');
115+
return '.\\gradlew.bat';
116116
} else if (
117117
(platform === 'linux' || platform === 'darwin') &&
118118
(await exists(path.join(folder.uri.fsPath!, 'gradlew')))
119119
) {
120-
return path.join(folder.uri.fsPath!, 'gradlew');
120+
return './gradlew';
121121
} else {
122122
throw new Error('Gradle wrapper executable not found');
123123
}
@@ -252,7 +252,7 @@ export function createTask(
252252
if (customBuildFile) {
253253
args.push('--build-file', customBuildFile);
254254
}
255-
return `${command} ${args.join(' ')}`;
255+
return `"${command}" ${args.join(' ')}`;
256256
}
257257

258258
function getRelativePath(

0 commit comments

Comments
 (0)