Skip to content

Commit c6c83c7

Browse files
committed
Remove trailing hyphen when no identifier used
Fixes #14
1 parent 772b7bd commit c6c83c7

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

runbook/cli/commands/create.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ def create(ctx, filename, template, language):
3939
# TODO: hide the nbconvert verbose output?
4040
argv = [
4141
"--ClearOutputPreprocessor.enabled=True",
42-
# Removes tags as well as everything else
43-
# "--ClearMetadataPreprocessor.enabled=True",
44-
# "--ClearMetadataPreprocessor.clear_notebook_metadata=False",
45-
# """--ClearMetadataPreprocessor.preserve_cell_metadata_mask='[("tags")]'""",
4642
template,
4743
"--to",
4844
"notebook",

runbook/cli/commands/plan.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ def plan(ctx, input, embed, identifier="", params={}):
2929
date = datetime.now().date()
3030
basename = path.basename(input)
3131
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+
)
3337
output = "-".join([str(date), basename_without_ext])
34-
# Output to folder to allow for embedding other files in same folder
3538
output_folder = f"./runbooks/runs/{output}"
3639
full_output = f"{output_folder}/{output_basename_without_ext}.ipynb"
3740

@@ -62,9 +65,6 @@ def plan(ctx, input, embed, identifier="", params={}):
6265

6366
argv = [
6467
"--ClearOutputPreprocessor.enabled=True",
65-
# "--ClearMetadataPreprocessor.enabled=True",
66-
# "--ClearMetadataPreprocessor.clear_notebook_metadata=False",
67-
# """--ClearMetadataPreprocessor.preserve_cell_metadata_mask='[("tags")]'""",
6868
"--inplace",
6969
full_output,
7070
]
@@ -79,7 +79,5 @@ def plan(ctx, input, embed, identifier="", params={}):
7979
for f in embed:
8080
shutil.copyfile(src=f, dst=f"{output_folder}/{path.basename(f)}")
8181

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)
8583
click.echo(click.style(f"Run your new runbook instance with:\n\t{cmd}"))

0 commit comments

Comments
 (0)