33 lines
651 B
Bash
Executable File
33 lines
651 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if test -z "$1"
|
|
then
|
|
install_dir="$HOME/.local/bin"
|
|
else
|
|
install_dir="$1"
|
|
fi
|
|
|
|
install_scripts() {
|
|
for f in *.sh
|
|
do
|
|
if ! printf "%s" "$f" | grep -q "install.sh"
|
|
then
|
|
full_path="${install_dir}/${f}"
|
|
cp "$f" "$install_dir"
|
|
printf "Copied %s to %s.\\n" "$f" "$full_path"
|
|
chmod +x "%s" "$full_path"
|
|
printf "Made %s executable.\\n" "$full_path"
|
|
printf ""
|
|
fi
|
|
done
|
|
}
|
|
|
|
if test -f "$install_dir"
|
|
then
|
|
install_scripts
|
|
else
|
|
printf "%s not found, creating...\\n" "$install_dir"
|
|
mkdir -p "$install_dir"
|
|
install_scripts
|
|
fi
|