mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 07:18:28 +01:00
Merge pull request #627 from efiop/master
dvc: stage: don't write None and empty lists
This commit is contained in:
+11
-5
@@ -161,11 +161,17 @@ class Stage(object):
|
||||
deps = [x.dumpd(self.cwd) for x in self.deps]
|
||||
outs = [x.dumpd(self.cwd) for x in self.outs]
|
||||
|
||||
return {
|
||||
Stage.PARAM_CMD: self.cmd,
|
||||
Stage.PARAM_DEPS: deps,
|
||||
Stage.PARAM_OUTS: outs,
|
||||
}
|
||||
ret = {}
|
||||
if self.cmd:
|
||||
ret[Stage.PARAM_CMD] = self.cmd
|
||||
|
||||
if len(deps):
|
||||
ret[Stage.PARAM_DEPS] = deps
|
||||
|
||||
if len(outs):
|
||||
ret[Stage.PARAM_OUTS] = outs
|
||||
|
||||
return ret
|
||||
|
||||
def dump(self, fname=None):
|
||||
if not fname:
|
||||
|
||||
Reference in New Issue
Block a user