Skip to content

Commit 6cf9cca

Browse files
committed
fix(cli): correctly clean on compas docker clean --project foo-bar with a - in the name
1 parent a6f65e7 commit 6cf9cca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/cli/src/compas/commands/docker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,16 +379,16 @@ async function cleanContainers(logger, state, context) {
379379
"SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid();";
380380
for (const command of stdout.split("\n")) {
381381
if (command.trim().startsWith("DROP DATABASE")) {
382-
pgCommand += `${command.trim()};`;
382+
pgCommand += `${command.trim()}`;
383383
}
384384
}
385385

386386
for (const project of projects) {
387-
pgCommand += `CREATE DATABASE ${project};`;
387+
pgCommand += `CREATE DATABASE "${project}";`;
388388
}
389389

390390
const { exitCode, ...dockerLogs } = await exec(
391-
`echo "${pgCommand}" | docker exec -i ${postgresContainer} psql --user postgres`,
391+
`echo '${pgCommand}' | docker exec -i ${postgresContainer} psql --user postgres`,
392392
);
393393

394394
if (exitCode !== 0) {

0 commit comments

Comments
 (0)