Binary exit code 0 on failed --apply-update
Posted: Mon Aug 10, 2015 7:32 am
I'm tinkering with scripting the update process (mainly for headless clients) and ran into an odd behaviour:
I'm running the core-linux64 package
Despite the Error from Util.cpp:46 the binary exits with code 0 indicating "everything went well during my execution"
I'm not sure if you would consider this a bug but if the binary would give a proper exit code we could get around having to parse the output for errors which seems kinda hackish
I'm running the core-linux64 package
Code: Select all
$ #Bash prompt
$ /opt/factorio/bin/x64/factorio --apply-update /tmp/nonexisting.zip
0.000 Info Main.cpp:150: Program arguments: "/opt/factorio/bin/x64/factorio" "--apply-update" "/tmp/nonexisting.zip"
0.000 2015-08-09 22:41:27; Factorio 0.12.2 (Build 16229, linux64)
0.000 Operating system: Linux
0.000 Read data path: /opt/factorio/data
0.000 Write data path: /opt/factorio
0.000 Binaries path: /opt/factorio/bin
0.030 Running in headless mode
0.035 Loading mod core 0.0.0 (data.lua)
0.041 Loading mod base 0.12.2 (data.lua)
0.979 Factorio initialised
0.980 Info Updater.cpp:358: Applying update /tmp/factorio-update*.zip
0.982 Error Util.cpp:46: Error opening update package: Opening zip /tmp/nonexisting.zip failed
1.006 Goodbye
$ echo $?
0
I'm not sure if you would consider this a bug but if the binary would give a proper exit code we could get around having to parse the output for errors which seems kinda hackish
