Skip to content

Commit c9bfece

Browse files
authored
Merge pull request popcorn-official#3017 from wiryhatbox/update-script
2 parents 8de73d4 + 7a52fe8 commit c9bfece

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

make_popcorn.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ else
2424
fi
2525

2626
clone_command() {
27-
if git clone $clone_url $dir; then
27+
if git clone "$clone_url" "$dir"; then
2828
echo "Cloned Popcorn Time successfully"
2929
else
3030
echo "Popcorn Time encountered an error and could not be cloned"
@@ -33,16 +33,16 @@ clone_command() {
3333
}
3434

3535
if [ -e ".git/config" ]; then
36-
dat=$(grep url .git/config)
37-
case $dat in *popcorn*)
36+
dat="$(grep url .git/config)"
37+
case "$dat" in *popcorn*)
3838
echo "You appear to be inside of a Popcorn Time repository already, not cloning"
3939
clone_repo="False"
4040
;;
4141
*)
4242
try="True"
4343
tries=0
4444
while [ "$try" = "True" ]; do
45-
read -p "Looks like we are inside a git repository, do you wish to clone inside it? (yes/no) [no] " rd_cln
45+
read -r -p "Looks like we are inside a git repository, do you wish to clone inside it? (yes/no) [no] " rd_cln
4646
if [ -z "$rd_cln" ]; then
4747
rd_cln='no'
4848
fi
@@ -57,7 +57,7 @@ if [ -e ".git/config" ]; then
5757
fi
5858
done
5959
if [ "$rd_cln" = "no" ]; then
60-
echo "You appear to be inside of a Popcorn Time repository already, not cloning"
60+
echo "Not cloning"
6161
clone_repo="False"
6262
else
6363
echo "You've chosen to clone inside the current directory"
@@ -67,7 +67,7 @@ if [ -e ".git/config" ]; then
6767
fi
6868
if [ "$clone_repo" = "True" ]; then
6969
echo "Cloning Popcorn Time"
70-
read -p "Where do you wish to clone Popcorn Time to? [popcorn] " dir
70+
read -r -p "Where do you wish to clone Popcorn Time to? [popcorn] " dir
7171
if [ -z "$dir" ]; then
7272
dir='popcorn'
7373
elif [ "$dir" = "/" ]; then
@@ -80,7 +80,7 @@ if [ "$clone_repo" = "True" ]; then
8080
try="True"
8181
tries=0
8282
while [ "$try" = "True" ]; do
83-
read -p "Directory $dir already exists, do you wish to delete it and redownload? (yes/no) [no] " rd_ans
83+
read -r -p "Directory $dir already exists, do you wish to delete it and redownload? (yes/no) [no] " rd_ans
8484
if [ -z "$rd_ans" ]; then
8585
rd_ans='no'
8686
fi
@@ -98,7 +98,7 @@ if [ "$clone_repo" = "True" ]; then
9898
echo "Removing old directory"
9999
if [ "$dir" != "." ] || [ "$dir" != "$PWD" ]; then
100100
echo "Cleaning up from inside the destination directory"
101-
rm -rf $dir
101+
rm -rf "$dir"
102102
fi
103103
clone_command
104104
else
@@ -110,7 +110,7 @@ fi
110110
if [ -z "$dir" ]; then
111111
dir="."
112112
fi
113-
cd $dir
113+
cd "$dir"
114114
echo "Switched to $PWD"
115115

116116
if [ "$rd_dep" = "yes" ]; then
@@ -124,7 +124,7 @@ fi
124124

125125
if yarn build; then
126126
echo "Popcorn Time built successfully!"
127-
if [[ `uname -s` != *"NT"* ]]; then # if not windows
127+
if [[ "$(uname -s)" != *"NT"* ]]; then # if not windows
128128
./Create-Desktop-Entry
129129
fi
130130
echo "Run 'yarn start' to launch the app or run Popcorn-Time from the ./build folder..."

0 commit comments

Comments
 (0)