62 lines
1.3 KiB
Makefile
62 lines
1.3 KiB
Makefile
# Main justfile
|
|
set shell := ["bash", "-uc"]
|
|
set quiet
|
|
set allow-duplicate-recipes := true
|
|
|
|
|
|
# wjust-dir := "~/.wjust"
|
|
wjust-dir := "~/git/wjust"
|
|
|
|
# container management commands, run `just container` to see all subcommands
|
|
mod container
|
|
|
|
# mod python
|
|
|
|
# mod container "{{wjust-dir}}/container/justfile"
|
|
# mod container "~/git/wjust/container/justfile"
|
|
# include "https://raw.githubusercontent.com/casey/just/refs/heads/master/justfile"
|
|
# include {{wjust-dir}}/container/justfile
|
|
|
|
|
|
[group('just')]
|
|
[private]
|
|
@default:
|
|
echo $PWD
|
|
@echo
|
|
@echo {{BOLD}}just{{NORMAL}}
|
|
@just --list
|
|
# @just container
|
|
|
|
# fuzzy picker
|
|
[group('just')]
|
|
f:
|
|
just --list | fzf | xargs just
|
|
|
|
pwd:
|
|
pwd
|
|
|
|
get-version:
|
|
#!/usr/bin/env bash
|
|
if [[ -f "version" ]]; then \
|
|
export PROJECT_VERSION=$(cat version); \
|
|
elif ABOUT_FILE=$(rg -l "__version__" --glob "**/__about__.py" | head -n 1); then \
|
|
export PROJECT_VERSION=$(rg -oP "(?<=__version__ = ['\"])[^'\"]+" "$ABOUT_FILE"); \
|
|
else \
|
|
echo "Version information not found!" >&2; \
|
|
exit 1; \
|
|
fi; \
|
|
export VERSION=$PROJECT_VERSION
|
|
|
|
version: get-version
|
|
#!/usr/bin/env bash
|
|
echo version is passed as $PROJECT_VERSION
|
|
|
|
# Run Ruff linter on Python files
|
|
[group('python')]
|
|
lint:
|
|
uv run ruff check .
|
|
|
|
# Run Ruff with auto-fix
|
|
[group('python')]
|
|
lint-fix:
|
|
uv run ruff check --fix .
|