Add require function to copy.sh
Add requirements for jq and gron - used by mirror.sh
This commit is contained in:
parent
48ebb1ea44
commit
b32cf97e95
22
copy.sh
22
copy.sh
|
@ -6,15 +6,21 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
||||
export f="$FAKE_HOME"
|
||||
|
||||
if ! command -v wget &> /dev/null; then
|
||||
echo "wget must be installed!"
|
||||
exit 1
|
||||
fi
|
||||
function require {
|
||||
local success=true
|
||||
for comm in "$@"; do
|
||||
if ! command -v "$comm" &> /dev/null; then
|
||||
echo "$comm must be installed!"
|
||||
success=false
|
||||
fi
|
||||
done
|
||||
if ! $success; then
|
||||
echo "Missing copy.sh dependencies! Exiting!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if ! command -v curl &> /dev/null; then
|
||||
echo "curl must be installed!"
|
||||
exit 1
|
||||
fi
|
||||
require git wget curl find jq gron
|
||||
|
||||
mkdir -p "$HOME/.tmp" || exit 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue