-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathphantom.config.json
More file actions
17 lines (17 loc) · 1.04 KB
/
phantom.config.json
File metadata and controls
17 lines (17 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"postCreate": {
"copyFiles": [
"CLAUDE.md"
],
"commands": [
"branch=$(git rev-parse --abbrev-ref HEAD); if [ \"$branch\" != \"main\" ]; then suffix=\"_$(echo $branch | tr '/' '_' | tr '-' '_')\"; if [ -f .env.local ] && grep -q '^BRANCH_DB_SUFFIX=' .env.local; then sed -i.bak \"s/^BRANCH_DB_SUFFIX=.*/BRANCH_DB_SUFFIX=$suffix/\" .env.local && rm .env.local.bak; else echo \"BRANCH_DB_SUFFIX=$suffix\" >> .env.local; fi; echo \"Set BRANCH_DB_SUFFIX=$suffix for branch $branch\"; else echo \"Main branch detected, no DB suffix needed\"; fi",
"mise trust",
"bin/setup"
]
},
"preDelete": {
"commands": [
"set +e; branch=$(git rev-parse --abbrev-ref HEAD); if [ \"$branch\" != \"main\" ]; then suffix=\"_$(echo $branch | tr '/' '_' | tr '-' '_')\"; dev_db=\"bootcamp_development$suffix\"; test_db=\"bootcamp_test$suffix\"; echo \"Dropping databases: $dev_db and $test_db\"; dropdb \"$dev_db\" || true; dropdb \"$test_db\" || true; else echo \"Main branch detected, no DB cleanup needed\"; fi; set -e"
]
}
}