mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-26 07:18:31 +01:00
run: use REMAINDER for command
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -108,6 +108,7 @@ def parse_args(argv=None):
|
||||
help='Lock data item - disable reproduction.')
|
||||
run_parser.add_argument(
|
||||
'command',
|
||||
nargs=argparse.REMAINDER,
|
||||
help='Command or command file to execute')
|
||||
run_parser.set_defaults(func=CmdRun)
|
||||
|
||||
|
||||
+4
-3
@@ -71,12 +71,13 @@ class CmdRun(CmdBase):
|
||||
|
||||
def run(self):
|
||||
with DvcLock(self.is_locker, self.git):
|
||||
cmd = ' '.join(self.parsed_args.command)
|
||||
try:
|
||||
command = CommandFile.load(self.parsed_args.command)
|
||||
command = CommandFile.load(cmd)
|
||||
#FIXME OLOLO don't forget to overwrite with cmdline args
|
||||
except Exception as exc:
|
||||
Logger.debug("Failed to load {}: {}".format(self.parsed_args.command[0], str(exc)))
|
||||
command = CommandFile(self.parsed_args.command, self.parsed_args.out, self.parsed_args.deps, self.parsed_args.lock, None)
|
||||
Logger.debug("Failed to load {}: {}".format(cmd, str(exc)))
|
||||
command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.deps, self.parsed_args.lock, None)
|
||||
|
||||
self.run_command(self.settings, command)
|
||||
return self.commit_if_needed('DVC run: {}'.format(command.cmd))
|
||||
|
||||
Reference in New Issue
Block a user