Skip to content

Commit

Permalink
linux doesn't support negative exit codes, replacing all of them to p…
Browse files Browse the repository at this point in the history
…ositive exit codes
  • Loading branch information
iaymerich committed Aug 16, 2018
1 parent 99f7279 commit d8db491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions jbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ func main() {
fmt.Println("Generating golang source class")
file, err := generateSource(tempWorkFolder)
if err != nil {
exitWithError(err,-1)
exitWithError(err,1)
}

destDir := *flagDest
err = os.MkdirAll(destDir, 0755)
if err != nil {
exitWithError(err,-2)
exitWithError(err,2)
}
sourceFile :=path.Join(destDir, nameSourceFile)
err = rename(file.Name(),sourceFile)
if err != nil {
exitWithError(err,-3)
exitWithError(err,3)
}
extension := "bin"
if strings.Compare(*flagPlatform,"windows")==0 {
Expand Down Expand Up @@ -297,7 +297,7 @@ func DownloadFile(filepath string, url string) error {
// Get the data
resp, err := http.Get(url)
if resp.StatusCode == 404 || resp.StatusCode == 409 {
exitWithError(errors.New(strings.Replace("URL Repository JRE not found: {url}","{url}",url,-1)),-4)
exitWithError(errors.New(strings.Replace("URL Repository JRE not found: {url}","{url}",url,-1)),4)
}
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// Describe version.
const Version string = "0.0.5-ALPHA3"
const Version string = "0.0.5-ALPHA4"

0 comments on commit d8db491

Please sign in to comment.