Skip to content

Commit 83ac538

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 bd44f8e commit 83ac538

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
@@ -48,6 +48,12 @@ export default class ShellCmd extends BaseCmd {
4848
}
4949
}
5050

51-
execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'})
51+
try {
52+
execSync(this.dockerBin + ' exec ' + container + ' [ -d "/home/ce-dev/deploy/live.local" ]')
53+
execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev/deploy/live.local ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'})
54+
}
55+
catch (err) {
56+
execSync(this.dockerBin + ' exec -it -u ce-dev -w /home/ce-dev ' + container + ' /bin/bash || exit 0', {stdio: 'inherit'})
57+
}
5258
}
5359
}

0 commit comments

Comments
 (0)