Skip to content

Commit

Permalink
fix arch for darwin arm64 (#617)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy LUGAGNE <[email protected]>
  • Loading branch information
JLugagne and JLugagne authored Apr 29, 2023
1 parent 1681491 commit 60f8c6e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/nodejs.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,14 @@ func getNodejsVersion() (version string, major int, err error) {
}

func installNodejs(dir string, version string) (err error) {
dlURL := fmt.Sprintf("https://nodejs.org/dist/v%s/node-v%s-%s-x64.tar.xz", version, version, runtime.GOOS)
arch := runtime.GOARCH
switch arch {
case "amd64":
arch = "x64"
case "386":
arch = "x86"
}
dlURL := fmt.Sprintf("https://nodejs.org/dist/v%s/node-v%s-%s-%s.tar.xz", version, version, runtime.GOOS, arch)
resp, err := fetch(dlURL)
if err != nil {
err = fmt.Errorf("download nodejs: %v", err)
Expand Down

0 comments on commit 60f8c6e

Please sign in to comment.