Skip to content

Commit 1b00d62

Browse files
committed
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
1 parent d812bad commit 1b00d62

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/commands/shell.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export default class ShellCmd extends BaseCmd {
4646
container = response.container
4747
}
4848
}
49-
execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' sudo su ce-dev || exit 0', {stdio: 'inherit'})
49+
try {
50+
execSync(this.dockerBin + ' exec ' + container + ' [ -d "/home/ce-dev/deploy/live.local" ]')
51+
execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev/deploy/live.local ' + container + ' sudo su ce-dev || exit 0', {stdio: 'inherit'})
52+
}
53+
catch {
54+
execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' sudo su ce-dev || exit 0', {stdio: 'inherit'})
55+
}
5056
}
5157
}

0 commit comments

Comments
 (0)