treat windows less differently
This commit is contained in:
parent
1c38262641
commit
dafc02201f
17
build-all.go
17
build-all.go
|
@ -165,7 +165,22 @@ func main() {
|
|||
panic(err)
|
||||
}
|
||||
strip := 1
|
||||
err = unzip(z, s.Size(), outdir, strip)
|
||||
if "windows" == pkg.os {
|
||||
// re-nest into "bin" for consistency
|
||||
err = unzip(z, s.Size(), filepath.Join(outdir, "bin"), strip)
|
||||
// handle the special case of git bash
|
||||
sh := strings.Join([]string{
|
||||
`#!/usr/bin/env bash`,
|
||||
`"$(dirname "$0")/node.exe" "$@"`,
|
||||
`exit $?`,
|
||||
}, "\n")
|
||||
script := filepath.Join(outdir, "bin", "node")
|
||||
if err := ioutil.WriteFile(script, []byte(sh), 0755); nil != err {
|
||||
panic(err)
|
||||
}
|
||||
} else {
|
||||
err = unzip(z, s.Size(), outdir, strip)
|
||||
}
|
||||
if nil != err {
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue