]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(docker-upgrade.sh): use command in a few places
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 10 Sep 2025 22:36:03 +0000 (00:36 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 10 Sep 2025 22:36:03 +0000 (00:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
scripts/docker-upgrade.sh

index 401e3b8f48360a5af1663b2645c9a60ff5dff036..426fdb3bb1fd16c8ff69f9ad99c2cb75a19beab5 100755 (executable)
@@ -34,7 +34,7 @@ LOCK_TAG=$(printf '%s' "$LOCAL_DOCKER_IMAGE" | LC_ALL=C tr -c 'A-Za-z0-9._-' '_'
 LOCKDIR="${TMPDIR:-/tmp}/docker-upgrade.${LOCK_TAG}.lock.d"
 
 if [ -d "$LOCKDIR" ]; then
-  _oldpid=$(sed -n '1p' "$LOCKDIR/pid" 2>/dev/null | tr -cd '0-9' || true)
+  _oldpid=$(command sed -n '1p' "$LOCKDIR/pid" 2>/dev/null | tr -cd '0-9' || true)
   if [ -n "$_oldpid" ] && is_pid_running "$_oldpid"; then
     echo_timestamped "Error: already running for ${LOCAL_DOCKER_IMAGE} (pid ${_oldpid})"
     exit 1
@@ -121,7 +121,7 @@ short_digest() {
     sha256:*) _h=${_d#sha256:} ;;
     *) _h="$_d" ;;
   esac
-  printf '%s' "$_h" | LC_ALL=C cut -c1-12
+  printf '%s' "$_h" | LC_ALL=C command cut -c1-12
   printf '\n'
 }