diff --git a/Makefile b/Makefile index 00ac29b..af08ef7 100644 --- a/Makefile +++ b/Makefile @@ -236,13 +236,13 @@ binfmt-register: .PHONY: version version: - @if printf -- '%s' '$(IMAGE_VERSION)' | grep -q '^v[0-9]\{1,\}$$'; then \ + @if printf '%s' '$(IMAGE_VERSION)' | grep -q '^v[0-9]\{1,\}$$'; then \ NEW_IMAGE_VERSION=$$(awk -v 'v=$(IMAGE_VERSION)' 'BEGIN {printf "v%.0f", substr(v,2)+1}'); \ - printf -- '%s\n' "$${NEW_IMAGE_VERSION:?}" > '$(VERSION_FILE)'; \ + printf '%s\n' "$${NEW_IMAGE_VERSION:?}" > '$(VERSION_FILE)'; \ '$(GIT)' add '$(VERSION_FILE)'; '$(GIT)' commit -m "$${NEW_IMAGE_VERSION:?}"; \ '$(GIT)' tag -a "$${NEW_IMAGE_VERSION:?}" -m "$${NEW_IMAGE_VERSION:?}"; \ else \ - >&2 printf -- 'Malformed version string: %s\n' '$(IMAGE_VERSION)'; \ + >&2 printf 'Malformed version string: %s\n' '$(IMAGE_VERSION)'; \ exit 1; \ fi diff --git a/run.sh b/run.sh index 0a47654..f65149f 100755 --- a/run.sh +++ b/run.sh @@ -17,21 +17,21 @@ containerExists() { "${DOCKER:?}" ps -af name="${1:?}" --format '{{.Names}}' | g containerIsRunning() { "${DOCKER:?}" ps -f name="${1:?}" --format '{{.Names}}' | grep -Fxq "${1:?}"; } if ! imageExists "${IMAGE_NAME:?}" && ! imageExists "${IMAGE_NAME#docker.io/}"; then - >&2 printf -- '%s\n' "\"${IMAGE_NAME:?}\" image doesn't exist!" + >&2 printf '%s\n' "\"${IMAGE_NAME:?}\" image doesn't exist!" exit 1 fi if containerIsRunning "${CONTAINER_NAME:?}"; then - printf -- '%s\n' "Stopping \"${CONTAINER_NAME:?}\" container..." + printf '%s\n' "Stopping \"${CONTAINER_NAME:?}\" container..." "${DOCKER:?}" stop "${CONTAINER_NAME:?}" >/dev/null fi if containerExists "${CONTAINER_NAME:?}"; then - printf -- '%s\n' "Removing \"${CONTAINER_NAME:?}\" container..." + printf '%s\n' "Removing \"${CONTAINER_NAME:?}\" container..." "${DOCKER:?}" rm "${CONTAINER_NAME:?}" >/dev/null fi -printf -- '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..." +printf '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..." "${DOCKER:?}" run --detach \ --name "${CONTAINER_NAME:?}" \ --hostname "${CONTAINER_NAME:?}" \ @@ -42,5 +42,5 @@ printf -- '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..." --env VM_KVM=true --device /dev/kvm \ "${IMAGE_NAME:?}" "$@" >/dev/null -printf -- '%s\n\n' 'Done!' +printf '%s\n\n' 'Done!' exec "${DOCKER:?}" logs -f "${CONTAINER_NAME:?}"