Skip to content

Commit 8694053

Browse files
Copilotmagerstam
andauthored
fix(scripts): canonicalize default cleanup workspace path
Agent-Logs-Url: https://github.com/open-edge-platform/image-composer-tool/sessions/41236530-0008-43cf-bb4d-a72a9887eed1 Co-authored-by: magerstam <77846379+magerstam@users.noreply.github.com>
1 parent bc35583 commit 8694053

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/cleanup_workspace

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set -euo pipefail
88
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
99
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
1010
DEFAULT_WORKSPACE_DIR="$REPO_ROOT/workspace"
11-
readonly DEFAULT_WORKSPACE_DIR
1211
WORKSPACE_DIR="$DEFAULT_WORKSPACE_DIR"
1312
MAX_UMOUNT_PASSES=5
1413
FORCE_DELETE=false
@@ -100,8 +99,14 @@ if ! command -v realpath >/dev/null 2>&1; then
10099
exit 1
101100
fi
102101

102+
if ! DEFAULT_WORKSPACE_DIR="$(realpath -m "$DEFAULT_WORKSPACE_DIR" 2>/dev/null)"; then
103+
echo "Failed to resolve default workspace directory path: $DEFAULT_WORKSPACE_DIR" >&2
104+
exit 1
105+
fi
106+
readonly DEFAULT_WORKSPACE_DIR
107+
103108
if ! WORKSPACE_DIR="$(realpath -m "$WORKSPACE_DIR" 2>/dev/null)"; then
104-
echo "Failed to resolve workspace directory path: $WORKSPACE_DIR" >&2
109+
echo "Failed to canonicalize workspace directory path (check permissions or path validity): $WORKSPACE_DIR" >&2
105110
exit 1
106111
fi
107112

0 commit comments

Comments
 (0)