Skip to content

Commit

Permalink
Search by pattern based on #24
Browse files Browse the repository at this point in the history
Consider allowing starting with``/``, ``./``, ``~`` or any string with a
``/`` within to be treated as pulling by file path.

```sh
$ vcspull ./.config
$ vcspull ./.config/*
$ vcspull ~/*
```

If starting with ``http``, ``git``, ``file``, try to find match with vcs
url
```sh
$ vcspull https://github.com/tony/vcspull.git
```

(done) Default, match repo name
```sh
$ vcspull vim
```
  • Loading branch information
tony committed Jan 27, 2016
1 parent 340e971 commit 53d10e3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vcspull/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ def cli(log_level, repos):
configs = find_configs(include_home=True)
configs = load_configs(configs)
for repo in repos:
dirmatch, repomatch = None, None
if any(repo.startswith(n) for n in ['./', '/', '~', '$HOME']):
dirmatch = repo
repo = None
elif any(repo.startswith(n) for n in ['http', 'git', 'svn']):
dirmatch = repo
repo = None

repos = get_repos(
configs,
dirmatch=None,
Expand Down

0 comments on commit 53d10e3

Please sign in to comment.