Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb87bfa146 | ||
|
|
69bd79e0fa |
No files matched your search
@@ -128,7 +128,7 @@ class FileGrouper:
|
|||||||
deepest = max(candidates, key=lambda p: len(Path(p).parts))
|
deepest = max(candidates, key=lambda p: len(Path(p).parts))
|
||||||
parent_path = str(Path(deepest).parent)
|
parent_path = str(Path(deepest).parent)
|
||||||
new_key = "root" if parent_path == "." else parent_path
|
new_key = "root" if parent_path == "." else parent_path
|
||||||
groups[new_key].extend(groups.pop(deepest))
|
groups.setdefault(new_key, []).extend(groups.pop(deepest))
|
||||||
return groups
|
return groups
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,11 +105,16 @@ class GitOperator:
|
|||||||
# ------------------------------------------------------------------ actions
|
# ------------------------------------------------------------------ actions
|
||||||
|
|
||||||
def stage(self, files: list[str]) -> None:
|
def stage(self, files: list[str]) -> None:
|
||||||
"""``git add`` the given paths."""
|
"""Stage the given paths — ``git add`` for existing files, ``git rm`` for deleted."""
|
||||||
if not files:
|
if not files:
|
||||||
return
|
return
|
||||||
|
existing = [f for f in files if Path(self.cwd or ".").joinpath(f).exists()]
|
||||||
|
deleted = [f for f in files if f not in existing]
|
||||||
try:
|
try:
|
||||||
self._run(["git", "add", *files])
|
if existing:
|
||||||
|
self._run(["git", "add", *existing])
|
||||||
|
if deleted:
|
||||||
|
self._run(["git", "rm", *deleted])
|
||||||
except GitError as e:
|
except GitError as e:
|
||||||
raise GitError(f"Could not stage files: {e}") from e
|
raise GitError(f"Could not stage files: {e}") from e
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "devgen-cli"
|
name = "devgen-cli"
|
||||||
version = "0.2.5"
|
version = "0.2.7"
|
||||||
description = "A collection of developer tools"
|
description = "A collection of developer tools"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="devgen-cli",
|
name="devgen-cli",
|
||||||
version="0.2.5",
|
version="0.2.7",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=[
|
install_requires=[
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "devgen-cli"
|
name = "devgen-cli"
|
||||||
version = "0.2.5"
|
version = "0.2.7"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "anthropic" },
|
{ name = "anthropic" },
|
||||||
|
|||||||
Reference in new issue
Block a user