diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/common | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -62,3 +62,17 @@ grep_path() { find `echo $path | tr : " "` -type f -executable 2>/dev/null | (egrep "$regex" || exit 0) } + +assert_valid_app_name() { + local app="$1"; shift + + local re="^[a-zA-Z][a-zA-Z0-9]*$" + if [[ ! $app =~ $re ]] + then + fatal "Invalid app name: \"$app\"" + fi +} + +# Save for later +usage_app=${0##*/} +echo_debug=${echo_debug-no} |