@@ -29,9 +29,12 @@ def plan(ctx, input, embed, identifier="", params={}):
29
29
date = datetime .now ().date ()
30
30
basename = path .basename (input )
31
31
basename_without_ext = basename [0 :- 6 ]
32
- output_basename_without_ext = basename_without_ext + "-" + identifier
32
+ output_basename_without_ext = basename_without_ext
33
+ if len (identifier ) > 0 :
34
+ output_basename_without_ext = "-" .join (
35
+ [output_basename_without_ext , identifier ]
36
+ )
33
37
output = "-" .join ([str (date ), basename_without_ext ])
34
- # Output to folder to allow for embedding other files in same folder
35
38
output_folder = f"./runbooks/runs/{ output } "
36
39
full_output = f"{ output_folder } /{ output_basename_without_ext } .ipynb"
37
40
@@ -62,9 +65,6 @@ def plan(ctx, input, embed, identifier="", params={}):
62
65
63
66
argv = [
64
67
"--ClearOutputPreprocessor.enabled=True" ,
65
- # "--ClearMetadataPreprocessor.enabled=True",
66
- # "--ClearMetadataPreprocessor.clear_notebook_metadata=False",
67
- # """--ClearMetadataPreprocessor.preserve_cell_metadata_mask='[("tags")]'""",
68
68
"--inplace" ,
69
69
full_output ,
70
70
]
@@ -79,7 +79,5 @@ def plan(ctx, input, embed, identifier="", params={}):
79
79
for f in embed :
80
80
shutil .copyfile (src = f , dst = f"{ output_folder } /{ path .basename (f )} " )
81
81
82
- cmd = click .style (
83
- f"$> runbook run { path .basename (full_output )} " , fg = "green" , bold = True
84
- )
82
+ cmd = click .style (f"$> runbook run { full_output } " , fg = "green" , bold = True )
85
83
click .echo (click .style (f"Run your new runbook instance with:\n \t { cmd } " ))
0 commit comments