bugfix pathman / serviceman links windows

This commit is contained in:
AJ ONeal 2019-08-09 23:09:12 -06:00
parent 1f736a71be
commit 1c38262641
1 changed files with 24 additions and 2 deletions

View File

@ -236,11 +236,22 @@ func main() {
pkg.os, pkg.os,
arch, arch,
) )
pathmanFile := filepath.Join(outdir, "bin", "pathman") + pkg.exe pathmanFile := filepath.Join(outdir, "node_modules/.bin", "pathman") + pkg.exe
err = download("pathman", pathmanURL, pathmanFile, true) err = download("pathman", pathmanURL, pathmanFile, true)
if nil != err { if nil != err {
panic(err) panic(err)
} }
if ".exe" == pkg.exe {
sh := strings.Join([]string{
`#!/usr/bin/env bash`,
`"$(dirname "$0")/pathman.exe" "$@"`,
`exit $?`,
}, "\n")
script := filepath.Join(outdir, "node_modules/.bin", "pathman")
if err := ioutil.WriteFile(script, []byte(sh), 0755); nil != err {
panic(err)
}
}
// Get serviceman for the platform // Get serviceman for the platform
servicemanURL := fmt.Sprintf( servicemanURL := fmt.Sprintf(
@ -248,11 +259,22 @@ func main() {
pkg.os, pkg.os,
arch, arch,
) )
servicemanFile := filepath.Join(outdir, "bin", "serviceman") + pkg.exe servicemanFile := filepath.Join(outdir, "node_modules/.bin", "serviceman") + pkg.exe
err = download("serviceman", servicemanURL, servicemanFile, true) err = download("serviceman", servicemanURL, servicemanFile, true)
if nil != err { if nil != err {
panic(err) panic(err)
} }
if ".exe" == pkg.exe {
sh := strings.Join([]string{
`#!/usr/bin/env bash`,
`"$(dirname "$0")/serviceman.exe" "$@"`,
`exit $?`,
}, "\n")
script := filepath.Join(outdir, "node_modules/.bin", "serviceman")
if err := ioutil.WriteFile(script, []byte(sh), 0755); nil != err {
panic(err)
}
}
// Write out the packaged deliverable // Write out the packaged deliverable
f, err := os.OpenFile(outdir+"."+pkg.ext, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) f, err := os.OpenFile(outdir+"."+pkg.ext, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)