Changeset - dcc31683bd76
[Not reviewed]
0 1 0
Branko Majic (branko) - 13 months ago 2024-10-21 15:19:35
branko@majic.rs
[factorio_manager.sh] Fix version extraction for Factorio 2.x:

- There are two lines beginning with the string "Version" - one is the
game version, while the other is the architecture
version (64-bit). This is a breaking change compared to the output
from Factorio 1.x.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
games/factorio_manager.sh
Show inline comments
 
@@ -2603,7 +2603,7 @@ elif [[ $command == install ]]; then
 
    # Extract the game version and verify it.
 
    tar --occurrence=1 --extract --file "$game_archive" --directory "$staging_directory" "factorio/bin/x64/factorio"
 

	
 
    game_version=$("$staging_factorio_bin" --version | grep '^Version' | sed -e 's/^Version: //;s/ .*//')
 
    game_version=$("$staging_factorio_bin" --version | grep '^Version' | head -n1 | sed -e 's/^Version: //;s/ .*//')
 

	
 
    if ! [[ $game_version =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
 
        error "Could not parse version from output of command: $staging_factorio_bin --version"
0 comments (0 inline, 0 general)