Created
June 24, 2020 01:19
-
-
Save braddevans/0e129afb888039154f67f7c62818f6fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# shellcheck disable=SC2140 | |
# shellcheck disable=SC2034 | |
# ## Variables ## # | |
input_file=$1 | |
input_file_name=$(echo "$input_file" | cut -d'.' -f1) | |
input_file_name_test=$(echo "$input_file" | cut -d'-' -f2) | |
input_file_name_test_version=$(echo "$input_file" | cut -d'-' -f3 | rev | cut -c5- | rev) | |
declare -a folders=( | |
"1122" | |
"1710" | |
) | |
# Example input file name: | |
# DEV-Towny-1.0.021.jar | |
# Output: | |
# Name: Towny | |
# Version: 1.0.021 | |
# ## functions ## # | |
echo "======================= Updater ======================="; | |
echo " "; | |
echo "Updating: ${input_file_name_test}"; | |
echo "Version: $input_file_name_test_version"; | |
echo " "; | |
echo "In all plugin folders: | |
[${folders[@]}]"; | |
echo " "; | |
echo " "; | |
for i in "${folders[@]}"; do | |
cp -v $input_file ../${i}/plugins/$input_file | |
done | |
echo " "; | |
echo " "; | |
echo "======================= Complete ======================="; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment