Create destination directory for script if not exist
This commit is contained in:
parent
00f6517d1f
commit
59fc963803
1 changed files with 8 additions and 3 deletions
11
install.sh
11
install.sh
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
required="sway swayidle swaylock waybar"
|
||||
|
||||
BIN_FOLDER="$HOME/.local/bin"
|
||||
|
||||
printf "Checking required programs :\n"
|
||||
for p in $required
|
||||
|
@ -21,12 +21,17 @@ done < <(ls -d -1 */)
|
|||
cd ..
|
||||
|
||||
printf "Create symblink for executables\n"
|
||||
if [ ! -d "$BIN_FOLDER" ]
|
||||
then
|
||||
printf "\tCreate $BIN_FOLDER\n"
|
||||
mkdir -p $BIN_FOLDER
|
||||
fi
|
||||
|
||||
cd bin
|
||||
while read d
|
||||
do
|
||||
printf "\t%s script found\n" "$d"
|
||||
rm -rf $HOME/.local/bin/${d}
|
||||
ln -s "$(pwd)/${d}" "$HOME/.local/bin/${d}"
|
||||
rm -rf $BIN_FOLDER/${d}
|
||||
ln -s "$(pwd)/${d}" "$BIN_FOLDER/${d}"
|
||||
done < <(ls -1 *)
|
||||
exit 0
|
||||
|
|
Reference in a new issue