@@ -37,15 +37,15 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
3737 panic (err )
3838 }
3939
40- copyTo (filepath . Join ( ".." , " changelog.txt") , filepath .Join (baseDir , "changelog.txt" ))
40+ copyTo (" changelog.txt" , filepath .Join (baseDir , "changelog.txt" ))
4141
4242 if forMac {
4343 baseDir = filepath .Join (baseDir , "MasterPlan.app" , "Contents" , "MacOS" )
4444 }
4545
4646 // Copy the assets folder to the bin directory
4747
48- copyTo (filepath . Join ( ".." , " assets") , filepath .Join (baseDir , "assets" ))
48+ copyTo (" assets" , filepath .Join (baseDir , "assets" ))
4949
5050 fmt .Println ("<Assets copied.>" )
5151
@@ -57,7 +57,7 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
5757
5858 // Copy the resources.syso so the executable has the generated icon and executable properties compiled in.
5959 // This is done using go generate with goversioninfo downloaded and "// go:generate goversioninfo -64=true" in main.go.
60- copyTo (filepath .Join (".." , " other_sources" , "resource.syso" ), filepath .Join (".." , "resource.syso" ))
60+ copyTo (filepath .Join ("other_sources" , "resource.syso" ), filepath .Join (".." , "resource.syso" ))
6161
6262 // Copy in the SDL requirements (.dll files)
6363 filepath .Walk (filepath .Join ("other_sources" ), func (path string , info fs.FileInfo , err error ) error {
@@ -96,9 +96,9 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
9696
9797 // Also note that I know it's weird that I'm joining the build script directory here because baseDir is already a folder up; this makes it so
9898 // bin is the running directory
99- c = exec .Command (`go` , `build` , `-C` , `..` , `- ldflags` , `-s -w -H windowsgui` , `-tags` , releaseMode , `-o` , filepath . Join ( "build_script" , outputFilepath ) , `.` )
99+ c = exec .Command (`go` , `build` , `-ldflags` , `-s -w -H windowsgui` , `-tags` , releaseMode , `-o` , outputFilepath , `.` )
100100 } else {
101- c = exec .Command (`go` , `build` , `-C` , `..` , `- ldflags` , `-s -w` , `-tags` , releaseMode , `-o` , filepath . Join ( "build_script" , outputFilepath ) , `.` )
101+ c = exec .Command (`go` , `build` , `-ldflags` , `-s -w` , `-tags` , releaseMode , `-o` , outputFilepath , `.` )
102102 }
103103
104104 fmt .Println ("<Building binary with args: " , c .Args , ".>" )
@@ -113,8 +113,8 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
113113 // Add the stuff for Mac
114114 if forMac {
115115 baseDir = filepath .Clean (filepath .Join (baseDir , ".." ))
116- copyTo (filepath .Join (".." , " other_sources" , "Info.plist" ), filepath .Join (baseDir , "Info.plist" ))
117- copyTo (filepath .Join (".." , " other_sources" , "macicons.icns" ), filepath .Join (baseDir , "Resources" , "macicons.icns" ))
116+ copyTo (filepath .Join ("other_sources" , "Info.plist" ), filepath .Join (baseDir , "Info.plist" ))
117+ copyTo (filepath .Join ("other_sources" , "macicons.icns" ), filepath .Join (baseDir , "Resources" , "macicons.icns" ))
118118 }
119119
120120 // The final executable should be, well, executable for everybody. 0777 should do it for Mac and Linux.
@@ -127,7 +127,7 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
127127
128128 if forWin {
129129 // Remove Resources; we don't need it in the root directory anymore after building.
130- os .Remove (filepath .Join (".." , " resource.syso" ))
130+ os .Remove (filepath .Join ("resource.syso" ))
131131 }
132132
133133}
@@ -255,8 +255,8 @@ func main() {
255255 targetArch = * archFlag
256256 }
257257
258- build (filepath .Join (".." , " bin" , targetName + "-0.9-Release-" + targetArch ), "release" , targetName , targetArch )
259- build (filepath .Join (".." , " bin" , targetName + "-0.9-Demo-" + targetArch ), "demo" , targetName , targetArch )
258+ build (filepath .Join ("bin" , targetName + "-0.9-Release-" + targetArch ), "release" , targetName , targetArch )
259+ build (filepath .Join ("bin" , targetName + "-0.9-Demo-" + targetArch ), "demo" , targetName , targetArch )
260260 }
261261 if * compressMP {
262262 compress () // Compresses all built binary folders in the ./bin folder
0 commit comments