summaryrefslogtreecommitdiff
path: root/osi-mk
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-08-12 18:15:43 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-08-12 18:15:43 -0400
commitab92364bddb89547b9ea044848d3fc8afb404ca3 (patch)
tree49d6e321a1ed6e613c9fd6480e0ac596261d6a1b /osi-mk
parent5c3011d3199d00ddfdb3b4740cfaf5725ac84717 (diff)
osi-mk: Sanity check arguments
Diffstat (limited to 'osi-mk')
-rwxr-xr-xosi-mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/osi-mk b/osi-mk
index 4ba520f..74badc9 100755
--- a/osi-mk
+++ b/osi-mk
@@ -107,6 +107,18 @@ main() {
else
arg_file=$1
fi
+ for module in "${arg_modules[@]}"; do
+ if ! [[ -f $module ]]; then
+ error 0 'Module does not exist: %s' "$module"
+ arg_mode=error
+ fi
+ done
+ for dirspec in "${arg_directories[@]}"; do
+ if ! [[ -d "${dirspec%:*}" ]]; then
+ error 0 'Directory does not exist: %s' "${dirspec%:*}"
+ arg_mode=error
+ fi
+ done
;;
esac
fi