Skip to content

Commit 64d01e4

Browse files
author
Christian Weichel
committed
Add support for workspace root packages
1 parent 99f8e51 commit 64d01e4

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
packages:
2+
- name: app
3+
type: go
4+
srcs:
5+
- "**/*.go"
6+
- go.mod
7+
- go.sum
8+
config:
9+
library: false

WORKSPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
defaultTarget: ":app"

pkg/leeway/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ func (p *Package) build(buildctx *buildContext) (err error) {
294294
pkgdir = strings.Replace(pkgdir, "/", "-", -1)
295295
pkgdir = strings.Replace(pkgdir, ":", "--", -1)
296296
pkgdir = pkgdir + "." + version
297+
// components in the workspace root would otherwise start with -- which breaks a lot of shell commands
298+
pkgdir = strings.TrimPrefix(pkgdir, "--")
297299

298300
builddir := filepath.Join(buildctx.BuildDir(), pkgdir)
299301
if _, err := os.Stat(builddir); !os.IsNotExist(err) {

0 commit comments

Comments
 (0)