Skip to content

2.0.0: New package name: g #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -119,6 +119,10 @@ $ vcspull "$HOME/code/*"

<img src="https://raw.githubusercontent.com/vcs-python/vcspull/master/docs/_static/vcspull-demo.gif" class="align-center" style="width:45.0%" alt="image" />

# Credits

2021-12-05: Thanks to [John Shanahan](https://github.com/shanahanjrs) ([@_shanahanjrs](https://twitter.com/_shanahanjrs)) for giving vcspull use [g](https://pypi.org/project/g/)

# Donations

Your donations fund development of new features, testing and support.
23 changes: 23 additions & 0 deletions g.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python

import pathlib
import subprocess
import sys

vcspath_registry = {".git": "git", ".svn": "svn", ".hg": "hg"}


def find_repo_type(path):
for path in list(pathlib.Path(path).parents) + [pathlib.Path(path)]:
for p in path.iterdir():
if p.is_dir():
if p.name in vcspath_registry:
return vcspath_registry[p.name]


vcs_bin = find_repo_type(pathlib.Path.cwd())


def run(cmd=vcs_bin, cmd_args=sys.argv[1:], *args, **kwargs):
proc = subprocess.Popen([cmd, *cmd_args])
proc.communicate()
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -21,10 +21,11 @@ classifiers = [
"Topic :: System :: Shells"
]
packages = [
{ include = "vcspull" }
{ include = "vcspull" },
]
include = [
{ path = "tests", format = "sdist" }
{ path = "tests", format = "sdist" },
{ path = "g.py" }
]
readme = 'README.md'
keywords = ["vcspull", "git", "vcs", "json", "yaml"]
@@ -39,6 +40,7 @@ Changes = "https://github.com/vcs-python/vcspull/blob/master/CHANGES"

[tool.poetry.scripts]
vcspull = 'vcspull:cli.cli'
g = 'g:run'

[tool.poetry.dependencies]
python = "^3.7"
@@ -82,5 +84,5 @@ format = ["black", "isort"]
lint = ["flake8"]

[build-system]
requires = ["poetry_core>=1.0.0"]
requires = ["poetry_core>=1.0.0", "setuptools>60"]
build-backend = "poetry.core.masonry.api"