aboutsummaryrefslogtreecommitdiffstats
path: root/cli/template/Justfile
diff options
context:
space:
mode:
authormurilo ijanc2025-11-20 17:03:54 -0300
committermurilo ijanc2025-11-20 17:03:54 -0300
commitefda331aa8bf3fb18f7cea38418e5952f02852f2 (patch)
tree9c2f8d25b5788d19fe75ba92df9b6a8ab313cd88 /cli/template/Justfile
parentcd7cf0434f173b3ac135f2678ab38d1bc82f19c4 (diff)
downloadtemplates-efda331aa8bf3fb18f7cea38418e5952f02852f2.tar.gz
Add template cli
Diffstat (limited to 'cli/template/Justfile')
-rw-r--r--cli/template/Justfile38
1 files changed, 38 insertions, 0 deletions
diff --git a/cli/template/Justfile b/cli/template/Justfile
new file mode 100644
index 0000000..d751545
--- /dev/null
+++ b/cli/template/Justfile
@@ -0,0 +1,38 @@
+#!/usr/bin/env -S just --justfile
+
+_default:
+ @just --list -u
+
+# ==================== ALIASES ====================
+alias r := ci
+
+# ==================== SETUP & INITIALIZATION ====================
+
+# Install git pre-commit hook to format files
+install-hook:
+ echo -e "#!/bin/sh\njust fmt" > .git/hooks/pre-commit
+ chmod +x .git/hooks/pre-commit
+
+# ==================== CORE DEVELOPMENT ====================
+
+watch +args='test --all':
+ cargo watch --clear --exec '{{args}}'
+
+ci:
+ cargo test --all
+ cargo clippy --all
+ cargo fmt --all -- --check
+
+# publish current master branch
+publish:
+ #!/usr/bin/env bash
+ set -euxo pipefail
+ rm -rf tmp/release
+ git clone git@github.com
+ VERSION=`sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1`
+ cd tmp/release
+ git tag -a $VERSION -m "Release $VERSION"
+ git push origin $VERSION
+ cargo publish
+ cd ../..
+ rm -rf tmp/release