-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecrets.sh
executable file
·49 lines (42 loc) · 1.41 KB
/
secrets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# ##############################################################################
# Secrets installation script for AndroidGameCollection
# ##############################################################################
# Declare variables
bashDir="$(dirname ${BASH_SOURCE[0]})";
scriptDir="$(cd ${bashDir} >/dev/null 2>&1 && pwd)";
cp="cp -vf";
games=(
"Emojidoku"
"FlagQuiz"
"FlagQuizEU"
"FlagQuizUSA"
"FlappyBlock"
"FloodIt"
"Sudoku"
"Superpong"
"TapTapTap"
"TicTacToe"
);
# Print the directory paths
echo "Welcome ${USER}, to secrets installation script for AndroidGameCollection.";
# Read the full path to the secrets directory
read -p "==> Please enter full path to the secret files directory: " dirPath;
echo "- Source directory: ${dirPath}";
echo "- Target directory: ${scriptDir}";
# Print actions to be taken, for verification
for game in "${games[@]}"; do
echo "VERIFY: ${dirPath}/${game}_Keys.xml => ${scriptDir}/${game}/src/main/res/values/keys.xml";
done;
# Ask permission from user and copy files
read -p "==> Are you sure to copy the files? (files will be overwritten) [y/N] " yn;
if [[ $yn =~ [yY](es)* ]]; then
for game in "${games[@]}"; do
$cp "${dirPath}/${game}_Keys.xml" "${scriptDir}/${game}/src/main/res/values/keys.xml";
done;
else
echo "==> Script was aborted by the user."
exit;
fi
# Print info that execution finished
echo "==> Script was finished succesfully.";