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
20
copy.sh
20
copy.sh
|
@ -6,15 +6,21 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
||||||
export f="$FAKE_HOME"
|
export f="$FAKE_HOME"
|
||||||
|
|
||||||
if ! command -v wget &> /dev/null; then
|
function require {
|
||||||
echo "wget must be installed!"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if ! command -v curl &> /dev/null; then
|
require git wget curl find jq gron
|
||||||
echo "curl must be installed!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$HOME/.tmp" || exit 1
|
mkdir -p "$HOME/.tmp" || exit 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue