Skip to content

Commit 4c9d085

Browse files
authored
dev/sg: create .bin if it does not exist (sourcegraph#42162)
1 parent a315ffb commit 4c9d085

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dev/sg/internal/run/run.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ func Commands(ctx context.Context, parentEnv map[string]string, verbose bool, cm
4646
return err
4747
}
4848

49+
// binaries get installed to <repository-root>/.bin. If the binary is installed with go build, then go
50+
// will create .bin directory. Some binaries (like docsite) get downloaded instead of built and therefore
51+
// need the directory to exist before hand.
52+
binDir := filepath.Join(root, ".bin")
53+
if err := os.Mkdir(binDir, 0755); err != nil && !os.IsExist(err) {
54+
return err
55+
}
56+
4957
wg := sync.WaitGroup{}
5058
installSemaphore := semaphore.NewWeighted(MAX_CONCURRENT_BUILD_PROCS)
5159
failures := make(chan failedRun, len(cmds))

0 commit comments

Comments
 (0)