Changeset - b01f9cb4f6fd
[Not reviewed]
0 1 0
Branko Majic (branko) - 4 years ago 2020-07-06 15:41:45
branko@majic.rs
Noticket: [factorio_manager.sh] Drop unused variables as reported by shellcheck.
1 file changed with 14 insertions and 8 deletions:
0 comments (0 inline, 0 general) First comment
games/factorio_manager.sh
Show inline comments
 
@@ -268,13 +268,22 @@ else
 
    _text_bold=""
 
    _text_reset=""
 

	
 
    # Part of the standard Majic Bash script template.
 
    # shellcheck disable=SC2034
 
    _bg_black=""
 
    # shellcheck disable=SC2034
 
    _bg_red=""
 
    # shellcheck disable=SC2034
 
    _bg_green=""
 
    # shellcheck disable=SC2034
 
    _bg_yellow=""
 
    # shellcheck disable=SC2034
 
    _bg_blue=""
 
    # shellcheck disable=SC2034
 
    _bg_purple=""
 
    # shellcheck disable=SC2034
 
    _bg_cyan=""
 
    # shellcheck disable=SC2034
 
    _bg_white=""
 
fi
 

	
 
@@ -555,7 +564,7 @@ function read_server_settings() {
 
    local server_name="$1"
 

	
 
    # Local helper variables.
 
    local key="" value="" prompt="" confirmed="" item="" validation_passed possible_values i
 
    local key="" value="" prompt="" confirmed="" item="" possible_values i
 

	
 
    declare -A settings_prompt=()
 
    declare -A settings_description=()
 
@@ -1158,7 +1167,8 @@ fi
 
# Parse the arguments
 
while getopts "qdvh" opt; do
 
    case "$opt" in
 
	q) quiet=1;;
 
	q) # shellcheck disable=SC2034 # part of standard Bash script template.
 
           quiet=1;;
 
	d) debug=1;;
 
        v) version
 
           exit "$SUCCESS";;
 
@@ -1549,7 +1559,6 @@ elif [[ $command == restore ]]; then
 
    instance_directory="$manager_directory/$instance"
 
    restore_source="$instance_directory/.bak/$backup_name"
 
    backup_instance_config="$restore_source/instance.conf"
 
    backup_game_config="$restore_source/config.ini"
 
    lock_file="$instance_directory/.lock"
 

	
 
    # Verify positional arguments.
 
@@ -1663,7 +1672,6 @@ elif [[ $command == remove-backup ]]; then
 
    instance_directory="$manager_directory/$instance"
 
    removal_target="$instance_directory/.bak/$backup_name"
 
    backup_instance_config="$removal_target/instance.conf"
 
    backup_game_config="$removal_target/config.ini"
 
    lock_file="$instance_directory/.lock"
 

	
 
    # Validate that instance directory contains valid instance.
 
@@ -2010,7 +2018,6 @@ elif [[ $command == copy ]]; then
 
    # Calculate derived variables.
 
    source_instance_directory="$manager_directory/$source_instance"
 
    source_instance_config="$source_instance_directory/instance.conf"
 
    source_game_config="$source_instance_directory/config.ini"
 
    source_lock_file="$source_instance_directory/.lock"
 

	
 
    destination_instance_directory="$manager_directory/$destination_instance"
 
@@ -2104,7 +2111,6 @@ elif [[ $command == import ]]; then
 
    instance_config="$instance_directory/instance.conf"
 
    game_config="$instance_directory/config.ini"
 

	
 
    source_config="$source_directory/config/config.ini"
 
    source_lock_file="$source_directory/.lock"
 

	
 
    # Make sure new instance directory can be used.
 
@@ -2339,8 +2345,8 @@ EOF
 
    game_directory="${game_installations_directory}/${game_version_selected}"
 
    factorio_bin="$game_directory/bin/x64/factorio"
 

	
 
    if ! "$factorio_bin" --config "$game_config" --create "$saves_directory/default.zip"; then
 
        error "Failed to generate default savegame/map under: $saves_directory/default.zip"
 
    if ! "$factorio_bin" --config "$game_config" --create "$main_save"; then
 
        error "Failed to generate default savegame/map under: $main_save"
 
        exit "$ERROR_GENERAL"
 
    fi
 

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