Changeset - 48415576fa5b
[Not reviewed]
0 1 0
Branko Majic (branko) - 4 years ago 2020-07-06 16:05:28
branko@majic.rs
Noticket: [factorio_manager.sh] Do not use bracket expansion for arithmetic tests and operations.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general) First comment
games/factorio_manager.sh
Show inline comments
 
@@ -231,13 +231,13 @@ $program, version $version
 
EOF
 
}
 

	
 
# Set-up colours for message printing if we're not piping and terminal is
 
# capable of outputting the colors.
 
_color_terminal=$(tput colors 2>&1)
 
if [[ -t 1 ]] && (( ${_color_terminal} > 0 )); then
 
if [[ -t 1 ]] && (( _color_terminal > 0 )); then
 
    _text_black=$(tput setaf 0)
 
    _text_red=$(tput setaf 1)
 
    _text_green=$(tput setaf 2)
 
    _text_yellow=$(tput setaf 3)
 
    _text_blue=$(tput setaf 4)
 
    _text_purple=$(tput setaf 5)
 
@@ -1072,13 +1072,13 @@ function select_factorio_version() {
 
    echo
 

	
 
    while [[ -z $game_version_selected ]]; do
 
        read -r -e -p "Please specify what version you would like to use (enter for $default_marker): " selected_option
 
        [[ -z $selected_option ]] && selected_option="$default_option"
 

	
 
        if [[ $selected_option =~ ^[[:digit:]]+$ ]] && (( $selected_option >= 1 && $selected_option <= ${#game_versions_available[@]} )); then
 
        if [[ $selected_option =~ ^[[:digit:]]+$ ]] && (( selected_option >= 1 && selected_option <= ${#game_versions_available[@]} )); then
 
            game_version_selected="${game_versions_available[$selected_option-1]}"
 
        else
 
            error "Invalid option selected, please try again."
 
            echo
 
        fi
 
    done
 
@@ -1176,13 +1176,13 @@ while getopts "qdvh" opt; do
 
           exit "$SUCCESS";;
 
        *) usage
 
           exit "$ERROR_ARGUMENTS";;
 
    esac
 
done
 
i=$OPTIND
 
shift $(($i-1))
 
shift $((i-1))
 

	
 
# Make sure the manager home directory exists.
 
if [[ ! -e $manager_directory ]]; then
 
    info "Creating Factorio Manager home directory under: $manager_directory"
 
    mkdir -p "$manager_directory"
 
fi
 
@@ -1215,13 +1215,13 @@ if [[ $command == set-game-dir ]]; then
 
    for candidate in "$game_installations_directory_target"/*; do
 
        if [[ -f $candidate/bin/x64/factorio ]]; then
 
            let factorio_versions_found++
 
        fi
 
    done
 

	
 
    if (( $factorio_versions_found == 0 )); then
 
    if (( factorio_versions_found == 0 )); then
 
        error "Could not locate any Factorio installations under: $game_installations_directory_target"
 

	
 
        exit "$ERROR_GENERAL"
 
    fi
 

	
 
    # Update the link
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now