Skip to content

Commit ab06c22

Browse files
committed
fix(build): macos not support
1 parent dfef525 commit ab06c22

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

cmd/volumes_test.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,18 @@ func TestVolumesClientCp(t *testing.T) {
162162
if err != nil {
163163
t.Fatal(err)
164164
}
165-
server.Mux.HandleFunc("/v2/apps/example-go/volumes/*", func(w http.ResponseWriter, r *http.Request) {
165+
server.Mux.HandleFunc("/v2/apps/example-go/volumes/myvolume/client/", func(w http.ResponseWriter, r *http.Request) {
166166
testutil.SetHeaders(w)
167-
if r.URL.Path == "/v2/apps/example-go/volumes/myvolume/client/" {
168-
if r.URL.RawQuery == "path=etc" {
169-
fmt.Fprintf(w, `{"results":[],"count":0}`)
170-
} else if r.Method == http.MethodGet {
171-
fmt.Fprintf(w, `{"results":[{"name":"hello.txt","size":"4159","timestamp":"2024-06-25T22:55:16+08:00","type":"file","path":"/hello.txt"}], "count": 1}`)
172-
}
173-
} else if r.URL.Path == "/v2/apps/example-go/volumes/myvolume/client/hello.txt" {
174-
testutil.SetHeaders(w)
175-
fmt.Fprintf(w, `hello word`)
167+
if r.URL.RawQuery == "path=etc" {
168+
fmt.Fprintf(w, `{"results":[],"count":0}`)
169+
} else if r.Method == http.MethodGet {
170+
fmt.Fprintf(w, `{"results":[{"name":"hello.txt","size":"4159","timestamp":"2024-06-25T22:55:16+08:00","type":"file","path":"/hello.txt"}], "count": 1}`)
176171
}
177172
})
173+
server.Mux.HandleFunc("/v2/apps/example-go/volumes/myvolume/client/hello.txt", func(w http.ResponseWriter, r *http.Request) {
174+
testutil.SetHeaders(w)
175+
fmt.Fprintf(w, `hello word`)
176+
})
178177
defer server.Close()
179178

180179
var b bytes.Buffer

scripts/build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ go-build(){
77
go build \
88
-o _dist/drycc-$1-$GOOS-$GOARCH \
99
drycc.go
10-
upx --lzma --best _dist/drycc-$1-$GOOS-$GOARCH
10+
if [[ "$GOOS" != "darwin" ]]; then
11+
upx --lzma --best _dist/drycc-$1-$GOOS-$GOARCH
12+
fi
1113
}
1214

1315
GOOS_LIST=("linux" "windows" "darwin")

0 commit comments

Comments
 (0)