From 83ac53892aff70ddf6d71fe6a5cd80ae0b26fe6b Mon Sep 17 00:00:00 2001 From: matason Date: Thu, 24 Jul 2025 16:02:17 +0200 Subject: [PATCH 1/2] 221: Improve the ce-dev shell command Running ce-dev shell now drops you into the root of the project, if it exists, instead of /home/ce-dev, and defaults to /home/ce-dev otherwise. fixes #221 --- src/commands/shell.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/shell.ts b/src/commands/shell.ts index 57b5887..16aa82c 100644 --- a/src/commands/shell.ts +++ b/src/commands/shell.ts @@ -48,6 +48,12 @@ export default class ShellCmd extends BaseCmd { } } - execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'}) + try { + execSync(this.dockerBin + ' exec ' + container + ' [ -d "/home/ce-dev/deploy/live.local" ]') + execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev/deploy/live.local ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'}) + } + catch (err) { + execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'}) + } } } From 238dddf99a08f6d1250ceb8ebf7c8bc137c2920c Mon Sep 17 00:00:00 2001 From: matason Date: Thu, 24 Jul 2025 16:11:59 +0200 Subject: [PATCH 2/2] 221: Remove unused err --- src/commands/shell.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/shell.ts b/src/commands/shell.ts index 16aa82c..84d556c 100644 --- a/src/commands/shell.ts +++ b/src/commands/shell.ts @@ -52,7 +52,7 @@ export default class ShellCmd extends BaseCmd { execSync(this.dockerBin + ' exec ' + container + ' [ -d "/home/ce-dev/deploy/live.local" ]') execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev/deploy/live.local ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'}) } - catch (err) { + catch { execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'}) } }