mirror of
https://github.com/kevinnlsamuel/bak-old.git
synced 2025-12-06 10:05:58 +05:30
check deps AFTER parsing options
just rearanged code
This commit is contained in:
34
bak-old.sh
34
bak-old.sh
@@ -179,23 +179,6 @@ parse_combined(){
|
|||||||
${DEBUG+debug} ###
|
${DEBUG+debug} ###
|
||||||
### if $DEBUG is set ###
|
### if $DEBUG is set ###
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# CHECKING DEPS
|
|
||||||
##################
|
|
||||||
deps=(realpath)
|
|
||||||
|
|
||||||
for dep in $deps; do
|
|
||||||
if command -v "$dep"; then
|
|
||||||
continue
|
|
||||||
else
|
|
||||||
missing=":${dep}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ -n ${missing} ]]; then
|
|
||||||
print_err_deps $missing
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# SANITISING PARAMS AND OPTIONS
|
# SANITISING PARAMS AND OPTIONS
|
||||||
##################################
|
##################################
|
||||||
@@ -244,6 +227,23 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# CHECKING DEPS
|
||||||
|
##################
|
||||||
|
deps=(realpath)
|
||||||
|
|
||||||
|
for dep in $deps; do
|
||||||
|
if command -v "$dep"; then
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
missing=":${dep}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n ${missing} ]]; then
|
||||||
|
print_err_deps $missing
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# THE ACTUAL COPYING CODE
|
# THE ACTUAL COPYING CODE
|
||||||
|
|||||||
Reference in New Issue
Block a user