Skip to content

Commit 8e01b9d

Browse files
author
Matthew Fisher
committed
fix(client): deis run no longer requires remote
TESTING: try to run a command outside of the git repository: $ cd .. $ deis run --app=foo ls If you're running a command that contains an option flag like `ls -al`, you can specify the `--` option beforehand: $ deis run --app=foo -- ls -al fixes #1086
1 parent c629d0c commit 8e01b9d

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

client/deis.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,12 @@ def apps_run(self, args):
579579
"""
580580
Run a command inside an ephemeral app container
581581
582-
Usage: deis apps:run <command>...
582+
Usage: deis apps:run [--app=<app> --] <command>...
583583
"""
584584
app = args.get('--app')
585585
if not app:
586586
app = self._session.app
587-
body = {'command': ' '.join(sys.argv[2:])}
587+
body = {'command': ' '.join(args.get('<command>'))}
588588
response = self._dispatch('post',
589589
"/api/apps/{}/run".format(app),
590590
json.dumps(body))
@@ -1611,11 +1611,10 @@ def main():
16111611
method = getattr(cli, cmd)
16121612
else:
16131613
raise DocoptExit('Found no matching command, try `deis help`')
1614-
# re-parse docopt with the relevant docstring unless it needs sys.argv
1615-
if cmd not in ('apps_run',):
1616-
docstring = trim(getattr(cli, cmd).__doc__)
1617-
if 'Usage: ' in docstring:
1618-
args.update(docopt(docstring))
1614+
# re-parse docopt with the relevant docstring
1615+
docstring = trim(getattr(cli, cmd).__doc__)
1616+
if 'Usage: ' in docstring:
1617+
args.update(docopt(docstring))
16191618
# dispatch the CLI command
16201619
_dispatch_cmd(method, args)
16211620

0 commit comments

Comments
 (0)