diff --git a/src/commands/shell.ts b/src/commands/shell.ts index 57b5887..84d556c 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 { + execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'}) + } } }