Commit 902cbfd2 authored by Ivan Mazhukin's avatar Ivan Mazhukin

cleanups

parent 5096bfd5
......@@ -107,8 +107,10 @@ require_command() {
}
sanitize_name() {
local value
value="$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]' | sed -e 's/[^a-z0-9]/-/g' -e 's/^-*//' -e 's/-*$//')"
local value="${1,,}"
value="${value//[^a-z0-9]/-}"
value="${value##-}"
value="${value%%-}"
printf '%s\n' "${value:-run}"
}
......@@ -118,7 +120,8 @@ normalize_system_name() {
local image_name
local image_tag
normalized="$(printf '%s' "$raw" | tr -d ' ' | tr '[:upper:]' '[:lower:]')"
normalized="${raw// /}"
normalized="${normalized,,}"
[[ -n "$normalized" ]] || fatal "Target system is empty"
......@@ -228,22 +231,9 @@ can_use_local_docker() {
verify_eepm_tree() {
local tree="$1"
local epm_path
[[ -d "$tree" ]] || fatal "eepm tree is not a directory: $tree"
epm_path="$tree/bin/eepm"
if [[ ! -e "$epm_path" ]]; then
fatal "eepm tree does not contain ./bin/eepm: $tree"
fi
if [[ ! -f "$epm_path" ]]; then
fatal "eepm entrypoint is not a regular file: $epm_path"
fi
if [[ ! -r "$epm_path" ]]; then
fatal "eepm entrypoint is not readable: $epm_path"
fi
[[ -f "$tree/bin/eepm" && -r "$tree/bin/eepm" ]] || fatal "eepm entrypoint not found or not readable: $tree/bin/eepm"
}
resolve_checked_source_path() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment