Skip to content

Commit

Permalink
feat(docker): Enter docker directly when no arguments (#191)
Browse files Browse the repository at this point in the history
* feat(docker): Enter docker directly when no arguments

* changelog
  • Loading branch information
jcs090218 authored Sep 20, 2023
1 parent d8f5c6e commit 63e4044
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
* Respect package file path in `autoload` command (44c042445bba0dd071d9112e58549437b7ebd58d)
* fix(vcpkg): Use workaround for `MODULE_NOT_FOUND` error (#187)
* Add docker command (#188)
* Enter docker directly when no arguments (#191)

## 0.8.x
> Released Mar 08, 2023
Expand Down
12 changes: 9 additions & 3 deletions cmds/core/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exports.handler = async (argv) => {
}

let project_dir = convert_path(process.cwd());
if (!project_dir.startsWith('/')) {
if (!project_dir.startsWith('/')) { // XXX: Ensure compatible to Unix path!
project_dir = '/' + project_dir;
}
let container_dir = '/' + path.basename(project_dir);
Expand All @@ -51,9 +51,15 @@ exports.handler = async (argv) => {
let default_cmd = ['docker', 'run', '--rm',
'-v', container_arg,
'-w', container_dir,
'silex/emacs:' + argv.version + '-ci-eask',
'eask'];
'silex/emacs:' + argv.version + '-ci-eask',];
let rest = process.argv.slice(4);

// If no argument; we enter the container directly!
if (rest.length == 0)
default_cmd.splice(2, 0, '-it');
else
default_cmd.push('eask');

let cmd = default_cmd.concat(rest);

let proc = child_process.spawn(UTIL.cli_args(cmd), { stdio: 'inherit', shell: true });
Expand Down

0 comments on commit 63e4044

Please sign in to comment.