Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .superset/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ step_load_env() {
echo "📂 Loading environment variables..."

if [ ! -f ".env" ]; then
error "No .env file found in current directory"
return 1
warn "No .env file found in current directory; using existing environment"
return 0
fi

set -a
Expand Down Expand Up @@ -146,18 +146,19 @@ step_delete_neon_branch() {

WORKSPACE_NAME="${SUPERSET_WORKSPACE_NAME:-$(basename "$PWD")}"

# Check if branch exists before attempting deletion
if ! neonctl branches get "$BRANCH_ID" --project-id "$NEON_PROJECT_ID" &> /dev/null; then
warn "Neon branch not found or already deleted: $WORKSPACE_NAME ($BRANCH_ID)"
return 0
fi

local output
if output=$(neonctl branches delete "$BRANCH_ID" --project-id "$NEON_PROJECT_ID" --force 2>&1); then
success "Neon branch deleted: $WORKSPACE_NAME ($BRANCH_ID)"
else
# Treat "not found" / "already deleted" as a skip, not a failure
if echo "$output" | grep -qiE "not found|does not exist|already deleted|404"; then
warn "Neon branch already deleted or not found: $WORKSPACE_NAME ($BRANCH_ID)"
else
error "Failed to delete Neon branch: $WORKSPACE_NAME ($BRANCH_ID)"
error "Output: $output"
return 1
fi
error "Failed to delete Neon branch: $WORKSPACE_NAME ($BRANCH_ID)"
error "Output: $output"
return 1
fi

return 0
Expand Down
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading