Skip to content

Commit

Permalink
Issue 468 (#471)
Browse files Browse the repository at this point in the history
  * removes bash-completion file from setup.py (fixes #468 )
  * do not execute 'rm -r' (dangerous!) if 'popper rm' cannot find a pipeline folder; throw an error instead.
  * init pipeline info message not shown.
  * bumps version up to 1.1.1
  * adds test to check that double `popper rm` doesn't do anything harmful
  • Loading branch information
ivotron authored Sep 19, 2018
1 parent 7603966 commit 5e0a83d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ popper_status
.cache
popper_logs
popper_status
.pipeline_cache.yml
2 changes: 2 additions & 0 deletions ci/test-rm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ init_test
popper init mypipetwo
popper rm mypipetwo

! popper rm mypipetwo

# test popper rm with paper
popper init paper
popper rm paper
2 changes: 1 addition & 1 deletion cli/popper/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.0'
__version__ = '1.1.1'
3 changes: 3 additions & 0 deletions cli/popper/commands/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def cli(ctx, name, stages, envs, existing, infer_stages, timeout):
relative_path=relative_path,
timeout=timeout
)
pu.info(
"Initialized pipeline '{}' at {}".format(name, relative_path),
fg='blue', bold=True)


def initialize_repo(project_root):
Expand Down
12 changes: 6 additions & 6 deletions cli/popper/commands/cmd_rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ def cli(ctx, pipeline):
"""

project_root = pu.get_project_root()
pipeline_dir = project_root

pipelines = pu.read_config()['pipelines']

if pipeline in pipelines:
path = pipelines[pipeline]['path']
pipeline_dir = os.path.join(
pipeline_dir,
project_root,
path)
else:
pu.fail("Pipeline '{}' not in this project".format(pipeline))

if os.path.isdir(pipeline_dir):

Expand All @@ -31,10 +31,10 @@ def cli(ctx, pipeline):
popper_config = pu.read_config()
del popper_config['pipelines'][pipeline]

pu.info("Pipeline {} removed successfully".format(pipeline),
fg="green")
pu.info("Pipeline '{}' removed successfully".format(pipeline),
fg="blue")

pu.write_config(popper_config)

else:
pu.fail("Pipeline {} doesn't exists".format(pipeline))
pu.fail("Path '{}' is not a folder".format(pipeline))
3 changes: 0 additions & 3 deletions cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
author_email='[email protected]',
url='http://falsifiable.us',
description='Popper CLI tool to generate reproducible papers.',
data_files=[
('/usr/local/etc/bash_completion.d', ['./extras/bash-completion.sh']),
],
packages=['popper', 'popper.commands'],
include_package_data=True,
install_requires=[
Expand Down

0 comments on commit 5e0a83d

Please sign in to comment.