added sd card command for plugin

This commit is contained in:
Roy 2024-05-04 00:50:55 -07:00 committed by GitHub
parent 6f567e1049
commit aeebd08f45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -812,6 +812,18 @@ move_to_sd() {
fi
}
# Check if the first command line argument is "Move to SD Card"
if [[ $1 == "Move to SD Card" ]]; then
# Shift the arguments to remove the first one
shift
# Use the remaining arguments as the launcher IDs to move
for launcher in "$@"; do
move_to_sd "$launcher"
done
else
# The first command line argument is not "Move to SD Card"
# Use Zenity to get the launcher IDs to move
if [[ $options == "Move to SD Card" ]]; then
CheckInstallationDirectory
@ -826,10 +838,18 @@ if [[ $options == "Move to SD Card" ]]; then
done
fi
# TODO: verify non-zero exit is necessary
# ! Why the non-zero return?
IFS="|" read -ra selected_launchers <<< "$move_options"
for launcher in "${selected_launchers[@]}"; do
move_to_sd "$launcher"
done
if [ $? -eq 0 ]; then
zenity --info --text="The selected directories have been moved to the SD card and symbolic links have been created." --width=200 --height=150
fi
# Exit the script
exit 1
exit 0
fi
fi
# Get the command line arguments