Skip to content

Commit 40aa0be

Browse files
authored
Co-locate Bazel output base with workspace (#82)
Fixes #81
1 parent f263902 commit 40aa0be

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ const platform = os.platform()
1616
let bazelOutputBase = core.getInput('output-base')
1717
if (!bazelOutputBase) {
1818
if (platform === 'win32') {
19-
bazelOutputBase = 'D:/_bazel'
19+
// check if GITHUB_WORKSPACE starts with D:
20+
if (process.env.GITHUB_WORKSPACE?.toLowerCase()?.startsWith('d:')) {
21+
bazelOutputBase = 'D:/_bazel'
22+
} else {
23+
bazelOutputBase = `C:/_bazel`
24+
}
2025
} else {
2126
bazelOutputBase = `${homeDir}/.bazel`
2227
}

dist/main/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ const platform = os.platform()
2222
let bazelOutputBase = core.getInput('output-base')
2323
if (!bazelOutputBase) {
2424
if (platform === 'win32') {
25-
bazelOutputBase = 'D:/_bazel'
25+
// check if GITHUB_WORKSPACE starts with D:
26+
if (process.env.GITHUB_WORKSPACE?.toLowerCase()?.startsWith('d:')) {
27+
bazelOutputBase = 'D:/_bazel'
28+
} else {
29+
bazelOutputBase = `C:/_bazel`
30+
}
2631
} else {
2732
bazelOutputBase = `${homeDir}/.bazel`
2833
}

dist/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ const platform = os.platform()
2222
let bazelOutputBase = core.getInput('output-base')
2323
if (!bazelOutputBase) {
2424
if (platform === 'win32') {
25-
bazelOutputBase = 'D:/_bazel'
25+
// check if GITHUB_WORKSPACE starts with D:
26+
if (process.env.GITHUB_WORKSPACE?.toLowerCase()?.startsWith('d:')) {
27+
bazelOutputBase = 'D:/_bazel'
28+
} else {
29+
bazelOutputBase = `C:/_bazel`
30+
}
2631
} else {
2732
bazelOutputBase = `${homeDir}/.bazel`
2833
}

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)