Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 9594c01

Browse files
committed
Hide sync behind build flag for windows
1 parent 2d52bb3 commit 9594c01

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

ci/steps/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ build(){
2929
# Darwin builds do not work from Linux, so only try to build them from Darwin.
3030
# See: https://github.com/cdr/coder-cli/issues/20
3131
if [[ "$(uname)" == "Darwin" ]]; then
32-
GOOS=linux build
3332
CGO_ENABLED=1 GOOS=darwin build
33+
GOOS=linux build
3434
GOOS=windows GOARCH=386 build
3535
exit 0
3636
fi
3737

3838
echo "Warning: Darwin builds don't work on Linux."
3939
echo "Please use an OSX machine to build Darwin tars."
4040
GOOS=linux build
41+
GOOS=windows GOARCH=386 build

internal/cmd/sync.go renamed to internal/cmd/sync_unix.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
package cmd
24

35
import (

internal/cmd/sync_windows.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// +build windows
2+
3+
package cmd
4+
5+
import (
6+
"github.com/spf13/cobra"
7+
"golang.org/x/xerrors"
8+
)
9+
10+
func makeSyncCmd() *cobra.Command {
11+
cmd := &cobra.Command{
12+
Use: "sync [local directory] [<env name>:<remote directory>]",
13+
Short: "NOT AVAILABLE ON WINDOWS – Establish a one way directory sync to a Coder environment",
14+
RunE: func(_ *cobra.Command, _ []string) error {
15+
return xerrors.Errorf(`"coder sync" is not available on Windows`)
16+
},
17+
}
18+
return cmd
19+
}

0 commit comments

Comments
 (0)