Changeset - bf5396f22815
[Not reviewed]
0 1 0
Branko Majic (branko) - 4 years ago 2020-07-06 16:06:56
branko@majic.rs
Noticket: [factorio_manager.sh] Properly quote variables when performing file globbing with arrays.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general) First comment
games/factorio_manager.sh
Show inline comments
 
@@ -1584,13 +1584,13 @@ elif [[ $command == restore ]]; then
 

	
 
    (
 
        lock "$lock_file" 200
 

	
 
        # Set-up a list of files and directories that will get removed.
 
        shopt -s nullglob
 
        entries_to_remove=($instance_directory/*)
 
        entries_to_remove=("$instance_directory"/*)
 
        shopt -u nullglob
 

	
 
        # Present user with extensive warning on consequences.
 
        echo
 
        warning "You are about to replace current instance's files, including (but not limited to):"
 
        warning
 
@@ -1807,13 +1807,13 @@ elif [[ $command == info ]]; then
 

	
 
    echo "Instance path: $(colorecho -n green "$instance_directory")"
 
    echo
 

	
 
    # Mod information.
 
    shopt -s nullglob
 
    mod_files=($instance_directory/mods/*.zip)
 
    mod_files=("$instance_directory/mods"/*.zip)
 
    mod_list="$instance_directory/mods/mod-list.json"
 
    shopt -u nullglob
 

	
 
    if [[ ${#mod_files[@]} == 0 ]]; then
 
        echo "Available mods: none"
 

	
 
@@ -1936,13 +1936,13 @@ elif [[ $command == remove ]]; then
 

	
 
    (
 
        lock "$lock_file" 200
 

	
 
        # Set-up a list of files and directories that will get removed.
 
        shopt -s nullglob dotglob
 
        entries_to_remove=($instance_directory/*)
 
        entries_to_remove=("$instance_directory"/*)
 
        shopt -u nullglob dotglob
 

	
 
        # Present user with extensive warning on consequences.
 
        echo
 
        warning "You are about to remove all instance's files, including (but not limited to):"
 
        warning
 
@@ -2065,13 +2065,13 @@ elif [[ $command == copy ]]; then
 
                echo
 
                error "Please answer only with 'y' or 'n'."
 
            fi
 
        done
 

	
 
        # Set-up a list of files and directories to copy.
 
        entries_to_copy=($source_instance_directory/*)
 
        entries_to_copy=("$source_instance_directory"/*)
 

	
 
        if [[ $copy_backups == "y" && -e "$source_instance_directory/.bak" ]]; then
 
             entries_to_copy+=("$source_instance_directory/.bak")
 
        fi
 

	
 
        # Create copy of source instance.
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now