-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
30 lines (23 loc) · 1.18 KB
/
Copy pathjustfile
File metadata and controls
30 lines (23 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
default:
@just --list
test:
nimble test
lint:
nph --check .
nimble check
fmt:
nph .
docs:
pip install --quiet mkdocs-material mkdocstrings-nim
mkdocs serve
build:
nimble build -d:release
# Manual fallback for template-cleanup (find/replace project_name -> kebab name).
# Cross-platform: uses python3 for find/replace (GNU vs BSD sed differences are avoided).
rename new_name:
@echo "Renaming project_name -> {{new_name}}"
@python3 -c "import sys, pathlib; new_kebab = sys.argv[1]; new_snake = new_kebab.replace('-', '_'); root = pathlib.Path('.'); [f.write_text(f.read_text(encoding='utf-8').replace('project_name', new_snake).replace('project-name', new_kebab), encoding='utf-8') for f in root.rglob('*') if f.is_file() and not any(p.startswith('.') for p in f.parts) and f.suffix in {'.nim', '.nimble', '.nims', '.md', '.yml', '.yaml', '.toml'}]" {{new_name}}
@python3 -c "import sys, pathlib; new_snake = sys.argv[1].replace('-', '_'); nimble = pathlib.Path('project_name.nimble'); nimble.rename(pathlib.Path(f'{new_snake}.nimble')) if nimble.is_file() else None" {{new_name}}
clean:
rm -rf nimcache htmldocs site
find . -name '*.exe' -delete