From 35d566d544d6709133a40c1cbdf6e2ce06977dcc Mon Sep 17 00:00:00 2001 From: Mike Lin Date: Sun, 30 Jan 2022 14:31:11 -1000 Subject: [PATCH] tidy --- WDL/Bundle.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/WDL/Bundle.py b/WDL/Bundle.py index f64d6346..363d739f 100644 --- a/WDL/Bundle.py +++ b/WDL/Bundle.py @@ -42,16 +42,17 @@ def build_layout(doc, ref=None): ans: Dict[str, Any] = {} if not input else {"input": input} ans["layout"] = build_layout(doc) - ans["sources"] = sources # strip common prefix from all abspaths, making bundle reproducible across machines - if len(ans["sources"]) > 1: - prefix = os.path.commonprefix([source["abspath"] for source in ans["sources"]]).rstrip("/") - for source in ans["sources"]: + if len(sources) > 1: + prefix = os.path.commonprefix([source["abspath"] for source in sources]).rstrip("/") + for source in sources: assert source["abspath"].startswith(prefix) source["abspath"] = source["abspath"][len(prefix) :] else: - ans["sources"][0]["abspath"] = "/" + os.path.basename(ans["sources"][0]["abspath"]) + sources[0]["abspath"] = "/" + os.path.basename(sources[0]["abspath"]) + + ans["sources"] = sources return ans