Skip to content

Commit

Permalink
fixing windows compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Levinson committed Mar 6, 2018
1 parent 95feb4a commit a0a0e35
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cmd/gscript/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,22 @@ func CompileScript(c *cli.Context) error {
}
}

finalFile := ""

if !outputSource && outputFile == "-" {
outputFile = filepath.Join(os.TempDir(), fmt.Sprintf("%d_genesis.bin", time.Now().Unix()))
finalFile = filepath.Join(os.TempDir(), fmt.Sprintf("%d_genesis.bin", time.Now().Unix()))
} else {
f, err := filepath.Abs(outputFile)
finalFile = f
if err != nil {
logger.Fatalf("Cannot determine path to outfile: %s", err.Error())
}
}
gcc := compiler.NewCompiler(scriptFiles, outputFile, compilerOS, compilerArch, outputSource, compressBinary, enableLogging)
gcc := compiler.NewCompiler(scriptFiles, finalFile, compilerOS, compilerArch, outputSource, compressBinary, enableLogging)
gcc.Logger = logger
gcc.Do()
if !outputSource {
gcc.Logger.Infof("Your binary is located at: %s", outputFile)
gcc.Logger.Infof("Your binary is located at: %s", finalFile)
}
return nil
}
Expand Down

0 comments on commit a0a0e35

Please sign in to comment.