Skip to content
This repository was archived by the owner on Jun 16, 2022. It is now read-only.

Commit f79e49e

Browse files
authored
Drop leading /
1 parent 93768c8 commit f79e49e

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function detect() {
7878
if (goModDir !== '.') {
7979
if (goBuildTarget.startsWith(goModDir)) {
8080
goBuildTarget = goBuildTarget.replace(goModDir, '');
81+
goBuildTarget = goBuildTarget.startsWith("/") ? goBuildTarget.substring(1) : goBuildTarget;
8182
}
8283
else {
8384
throw new Error(`The build target ${goBuildTarget} is not a sub-directory of ${goModDir}`);

dist/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.

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ async function detect () {
4444
if (goModDir !== '.') {
4545
if (goBuildTarget.startsWith(goModDir)) {
4646
goBuildTarget = goBuildTarget.replace(goModDir, '')
47+
goBuildTarget = goBuildTarget.startsWith('/')
48+
? goBuildTarget.substring(1)
49+
: goBuildTarget
4750
} else {
4851
throw new Error(
4952
`The build target ${goBuildTarget} is not a sub-directory of ${goModDir}`

0 commit comments

Comments
 (0)