Skip to content

Commit 76987ff

Browse files
author
binarygit
committed
fix: sh 'cd go ...' fails
1 parent 3ed4844 commit 76987ff

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Rakefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,19 @@ begin
7070
platform = detect_go_platform
7171
output_dir = "go/build/#{platform}"
7272
FileUtils.mkdir_p(output_dir)
73-
sh "cd go && CGO_ENABLED=1 go build -buildmode=c-archive -o build/#{platform}/libglamour.a ."
73+
Dir.chdir("./go") do
74+
sh "CGO_ENABLED=1 go build -buildmode=c-archive -o build/#{platform}/libglamour.a ."
75+
end
7476
end
7577

7678
desc "Build Go archives for all platforms"
7779
task :build_all do
7880
GO_PLATFORMS.each_value do |env|
7981
output_dir = "go/build/#{env[:goos]}_#{env[:goarch]}"
8082
FileUtils.mkdir_p(output_dir)
81-
sh "cd go && CGO_ENABLED=1 GOOS=#{env[:goos]} GOARCH=#{env[:goarch]} go build -buildmode=c-archive -o build/#{env[:goos]}_#{env[:goarch]}/libglamour.a ."
83+
Dir.chdir("./go") do
84+
sh "CGO_ENABLED=1 GOOS=#{env[:goos]} GOARCH=#{env[:goarch]} go build -buildmode=c-archive -o build/#{env[:goos]}_#{env[:goarch]}/libglamour.a ."
85+
end
8286
end
8387
end
8488

0 commit comments

Comments
 (0)