Skip to content

Commit

Permalink
Merge pull request #138 from JrGoodle/version_enhancements
Browse files Browse the repository at this point in the history
Allow version and branch to be specified for clowder herd
  • Loading branch information
JrGoodle committed Jan 24, 2016
2 parents c44a245 + d2be6cf commit ba10166
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $ brew install python3
To install from the [GitHub Releases](https://github.com/JrGoodle/clowder/releases) open a terminal and run:

```bash
$ pip3 install https://github.com/JrGoodle/clowder/releases/download/1.0.0/clowder-1.0.0-py3-none-any.whl
$ pip3 install https://github.com/JrGoodle/clowder/releases/download/1.0.1/clowder-1.0.1-py3-none-any.whl
```

For terminal autocompletion, add the following to your shell profile:
Expand Down
17 changes: 11 additions & 6 deletions clowder/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self):
self.args = parser.parse_args()

if self.args.clowder_version:
print('clowder version 1.0.0')
print('clowder version 1.0.1')
sys.exit(0)
print('')
if self.args.command is None or not hasattr(self, self.args.command):
Expand Down Expand Up @@ -96,7 +96,13 @@ def herd(self):
"""clowder herd command"""
if self.clowder_repo is not None:
self.clowder_repo.print_status()
self.clowder_repo.symlink_yaml(self.args.version)

if self.args.version is None:
version = None
else:
version = self.args.version[0]

self.clowder_repo.symlink_yaml(version)
print('')
# Create new clowder in case symlink changed
clowder = ClowderController(self.root_directory)
Expand Down Expand Up @@ -286,10 +292,9 @@ def _configure_subparser_herd(self, subparsers):
parser_herd = subparsers.add_parser('herd', help=herd_help)
parser_herd.add_argument('--depth', '-d', default=None, type=int, nargs=1,
help='Depth to herd')
group_herd = parser_herd.add_mutually_exclusive_group()
group_herd.add_argument('--version', '-v', choices=self.versions,
help='Version name to herd')
group_herd.add_argument('--branch', '-b', nargs=1, default=None, help='Branch to herd')
parser_herd.add_argument('--version', '-v', choices=self.versions, nargs=1,
default=None, help='Version name to herd')
parser_herd.add_argument('--branch', '-b', nargs=1, default=None, help='Branch to herd')
group_herd = parser_herd.add_mutually_exclusive_group()
group_herd.add_argument('--groups', '-g', choices=self.group_names,
default=self.group_names, nargs='+', help='Groups to herd')
Expand Down
9 changes: 3 additions & 6 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ $ clowder herd -g clang llvm
# Only herd clang project
$ clowder herd -p llvm-mirror/clang

# Herd specified branch for projects in clang and llvm groups
$ clowder herd -b my_branch -g clang llvm

# Herd specified branch for the clang project
$ clowder herd -b my_branch -p llvm-mirror/clang

# Point clowder.yaml symlink to saved version
$ clowder herd -v 0.1

# Multiple arguments
$ clowder herd -v 0.1 -b my_branch -g clang llvm -d 1
```

---
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
setup(
name='clowder',
description='A tool for managing code',
version='1.0.0',
version='1.0.1',
url='http://clowder.cat',
author='joe DeCapo',
author_email='joe@polka.cat',
Expand Down

0 comments on commit ba10166

Please sign in to comment.