26 lines
439 B
Bash
Executable file
26 lines
439 B
Bash
Executable file
#!/bin/bash
|
|
|
|
build () {
|
|
dir="$1"
|
|
i="$2"
|
|
cd "./$dir" || exit
|
|
f=$(echo "$dir" | sed 's/\.\///')
|
|
nimble install -y
|
|
if [[ $i == "install" ]]; then
|
|
cp -v "$f" "$HOME/.local/bin/$f"
|
|
fi
|
|
cd ../
|
|
}
|
|
|
|
if [[ $2 != "" ]]; then
|
|
build "$2" "$1"
|
|
exit
|
|
fi
|
|
for dir in ./*; do
|
|
if [ -d "$dir" ]; then
|
|
if [[ "$dir" == "./" ]]; then
|
|
continue
|
|
fi
|
|
build "$dir" "$1"
|
|
fi
|
|
done
|