aboutsummaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
authorSam Scholten2025-10-20 17:30:10 +1000
committerSam Scholten2025-10-20 17:32:27 +1000
commit80efd025bb68cc193ad94ad17e397f8ce179d1b3 (patch)
tree853081d04cafdf43c8a074630ce9145b516a4ea3 /justfile
parent06eac8e8d4acfdb454324e783147b51f2e620474 (diff)
downloadbibiman-man.tar.gz
bibiman-man.zip
add man pages & justfile to organiseman
Diffstat (limited to 'justfile')
-rw-r--r--justfile76
1 files changed, 76 insertions, 0 deletions
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..4094b20
--- /dev/null
+++ b/justfile
@@ -0,0 +1,76 @@
+# Justfile for bibiman
+
+# Installation directories
+PREFIX := "/usr/local"
+MANDIR := PREFIX + "/man"
+BINDIR := PREFIX + "/bin"
+
+# Default recipe
+default: build
+
+# Build the binary in release mode
+build:
+ cargo build --release
+
+# Development build
+dev:
+ cargo build
+
+# Run the binary in development mode
+run: dev
+ cargo run
+
+# Install the binary and man pages
+# Note: Requires sudo when installing to system directories
+install: build
+ #!/usr/bin/env sh
+ set -eu
+ install -D target/release/bibiman "${DESTDIR:-}"{{BINDIR}}/bibiman
+ install -D man/bibiman.1 "${DESTDIR:-}"{{MANDIR}}/man1/bibiman.1
+ install -D man/bibiman.toml.5 "${DESTDIR:-}"{{MANDIR}}/man5/bibiman.toml.5
+ echo "Installation complete. Run 'sudo mandb' to update man page database if needed."
+
+# Install only man pages
+# Note: Requires sudo when installing to system directories
+install-man:
+ #!/usr/bin/env sh
+ set -eu
+ install -D man/bibiman.1 "${DESTDIR:-}"{{MANDIR}}/man1/bibiman.1
+ install -D man/bibiman.toml.5 "${DESTDIR:-}"{{MANDIR}}/man5/bibiman.toml.5
+ echo "Man pages installed. Run 'sudo mandb' to update man page database if needed."
+
+# Uninstall
+uninstall:
+ #!/usr/bin/env sh
+ set -eu
+ rm -f "${DESTDIR:-}"{{BINDIR}}/bibiman
+ rm -f "${DESTDIR:-}"{{MANDIR}}/man1/bibiman.1
+ rm -f "${DESTDIR:-}"{{MANDIR}}/man5/bibiman.toml.5
+
+# Clean build artifacts
+clean:
+ cargo clean
+
+# Run tests
+test:
+ cargo test
+
+# Format code
+fmt:
+ cargo fmt --all
+
+# Run clippy lints
+clippy:
+ cargo clippy -- -D warnings
+
+# Check the code
+check:
+ cargo check
+
+# Build and run with test files
+test-run: dev
+ cargo run -- tests/biblatex-test.bib
+
+# Show available recipes
+list:
+ just --list \ No newline at end of file