Skip to content

Commit 697e3b8

Browse files
committed
Fix CI shellcheck findings and bump v0.1.2
1 parent cb5b62f commit 697e3b8

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.1.2] - 2026-03-04
6+
7+
### Fixed
8+
9+
- Refined CLI numeric argument validation to satisfy strict CI shellcheck checks.
10+
511
## [0.1.1] - 2026-03-04
612

713
### Changed

scripts/utm-timevault.sh

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
VERSION="0.1.1"
4+
VERSION="0.1.2"
55

66
EXIT_OK=0
77
EXIT_RUNTIME=1
@@ -1004,9 +1004,18 @@ cmd_backup() {
10041004
done
10051005

10061006
[ -n "$vm" ] || { err "--vm is required."; usage_backup; return "$EXIT_USAGE"; }
1007-
is_uint "$keep" && [ "$keep" -ge 1 ] || { err "--keep must be >= 1."; return "$EXIT_USAGE"; }
1008-
is_uint "$UTM_STOP_TIMEOUT_SEC" && [ "$UTM_STOP_TIMEOUT_SEC" -ge 1 ] || { err "--timeout must be >= 1."; return "$EXIT_USAGE"; }
1009-
is_uint "$UTM_STOP_POLL_INTERVAL_SEC" && [ "$UTM_STOP_POLL_INTERVAL_SEC" -ge 1 ] || { err "--poll must be >= 1."; return "$EXIT_USAGE"; }
1007+
if ! is_uint "$keep" || [ "$keep" -lt 1 ]; then
1008+
err "--keep must be >= 1."
1009+
return "$EXIT_USAGE"
1010+
fi
1011+
if ! is_uint "$UTM_STOP_TIMEOUT_SEC" || [ "$UTM_STOP_TIMEOUT_SEC" -lt 1 ]; then
1012+
err "--timeout must be >= 1."
1013+
return "$EXIT_USAGE"
1014+
fi
1015+
if ! is_uint "$UTM_STOP_POLL_INTERVAL_SEC" || [ "$UTM_STOP_POLL_INTERVAL_SEC" -lt 1 ]; then
1016+
err "--poll must be >= 1."
1017+
return "$EXIT_USAGE"
1018+
fi
10101019

10111020
case "$mode" in
10121021
auto|snapshot|archive) ;;
@@ -1080,8 +1089,14 @@ cmd_restore() {
10801089

10811090
[ -n "$vm" ] || { err "--vm is required."; usage_restore; return "$EXIT_USAGE"; }
10821091
[ -n "$source" ] || { err "--source is required."; usage_restore; return "$EXIT_USAGE"; }
1083-
is_uint "$UTM_STOP_TIMEOUT_SEC" && [ "$UTM_STOP_TIMEOUT_SEC" -ge 1 ] || { err "--timeout must be >= 1."; return "$EXIT_USAGE"; }
1084-
is_uint "$UTM_STOP_POLL_INTERVAL_SEC" && [ "$UTM_STOP_POLL_INTERVAL_SEC" -ge 1 ] || { err "--poll must be >= 1."; return "$EXIT_USAGE"; }
1092+
if ! is_uint "$UTM_STOP_TIMEOUT_SEC" || [ "$UTM_STOP_TIMEOUT_SEC" -lt 1 ]; then
1093+
err "--timeout must be >= 1."
1094+
return "$EXIT_USAGE"
1095+
fi
1096+
if ! is_uint "$UTM_STOP_POLL_INTERVAL_SEC" || [ "$UTM_STOP_POLL_INTERVAL_SEC" -lt 1 ]; then
1097+
err "--poll must be >= 1."
1098+
return "$EXIT_USAGE"
1099+
fi
10851100

10861101
require_dependencies || return "$?"
10871102
do_restore_for_vm_and_source "$vm" "$source" "$assume_yes"

0 commit comments

Comments
 (0)