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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ jobs:
exit 1
fi

- name: Guard guided setup Compose rewrites
run: bash scripts/check-guided-setup-compose-rewrites.sh
- name: Guard guided setup behavior
run: |
bash scripts/check-guided-setup-compose-rewrites.sh
bash scripts/check-guided-setup-default-project.sh

- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
Expand Down
28 changes: 28 additions & 0 deletions scripts/check-guided-setup-default-project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
TMP_DIR="$(mktemp -d)"

cleanup() {
rm -rf "${TMP_DIR}"
}
trap cleanup EXIT

FUNCTIONS_FILE="${TMP_DIR}/guided-setup-functions.sh"
WORK_DIR="${TMP_DIR}/breeze"

sed '/^main "\$@"$/d' "${REPO_ROOT}/scripts/guided-setup.sh" > "${FUNCTIONS_FILE}"
mkdir -p "${WORK_DIR}"
cp "${REPO_ROOT}/.env.example" "${WORK_DIR}/.env"

(
set -- --work-dir "${WORK_DIR}" --env-file "${WORK_DIR}/.env" --no-download --no-up -y
# shellcheck source=/dev/null
source "${FUNCTIONS_FILE}"
preserve_existing_compose_project_name
)

printf 'guided setup default project name guard passed\n'
2 changes: 1 addition & 1 deletion scripts/guided-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ preserve_existing_compose_project_name() {
local configured name volume_name

name="$(sanitize_compose_project_name "$(basename "${WORK_DIR}")")"
[[ -n "${name}" && "${name}" != "breeze" ]] || return
[[ -n "${name}" && "${name}" != "breeze" ]] || return 0

volume_name="${name}_postgres_data"
configured="$(get_env_value "COMPOSE_PROJECT_NAME")"
Expand Down
Loading