Skip to content

Commit

Permalink
Rewrite CLI in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Jul 21, 2023
1 parent eccc6e6 commit 4ea93a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nix & devenv
result
.env*
/.env*
.devenv*
/.cache
/.pre-commit-config.yaml
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/cachix/devenv"
packages = [{include = "devenv", from = "src"}]
include = [
{ path = "src", format = ["sdist", "wheel"] },
{ path = "examples", format = ["sdist", "wheel"] }
{ path = "examples/simple", format = ["sdist", "wheel"] }
]

[tool.poetry.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions src/devenv/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"false",
]

SRC_DIR = Path(pkgutil.get_loader(__package__).load_module(__package__).__file__, '..', '..')
SRC_DIR = Path(pkgutil.get_loader(__package__).load_module(__package__).__file__, '..', '..', 'src')
MODULES_DIR = (SRC_DIR / 'modules').resolve()
FLAKE_FILE_TEMPL = os.path.join(MODULES_DIR, "flake.tmpl.nix")
FLAKE_FILE = ".devenv.flake.nix"
Expand Down Expand Up @@ -360,7 +360,7 @@ def init(target):
return

example = "simple"
examples_path = Path(MODULES_DIR, "..", "..", "examples")
examples_path = Path(MODULES_DIR / ".." / ".." / "examples").resolve()

for filename in required_files:
full_filename = Path(target, filename)
Expand Down Expand Up @@ -417,4 +417,4 @@ def print_dev_env():

def get_version():
with open(Path(MODULES_DIR, "latest-version")) as f:
return f.read().strip()
return f.read().strip()

0 comments on commit 4ea93a4

Please sign in to comment.