Skip to content

Commit cac7745

Browse files
committed
just: migrate from make and more recipes
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent f156c1d commit cac7745

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use nix

Makefile

-10
This file was deleted.

justfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Use `just <recipe>` to run a recipe
2+
# https://just.systems/man/en/
3+
4+
# By default, run the `--list` command
5+
default:
6+
@just --list
7+
8+
# Variables
9+
10+
transferDir := `if [ -d "$HOME/NextcloudPrivate/Transfer" ]; then echo "$HOME/NextcloudPrivate/Transfer"; else echo "$HOME/Nextcloud/Transfer"; fi`
11+
12+
# Apply the patch to the qownnotes-scripts repository
13+
[group('patch')]
14+
git-apply-patch:
15+
git apply {{ transferDir }}/qownnotes-scripts.patch
16+
17+
# Create a patch from the staged changes in the qownnotes-scripts repository
18+
[group('patch')]
19+
@git-create-patch:
20+
echo "transferDir: {{ transferDir }}"
21+
git diff --no-ext-diff --staged --binary > {{ transferDir }}/qownnotes-scripts.patch
22+
ls -l1t {{ transferDir }}/ | head -2
23+
24+
# Test the qownnotes-scripts repository
25+
[group('test')]
26+
@test:
27+
php ./.github/workflows/scripts/run-tests.php
28+
29+
# Format all justfiles
30+
[group('linter')]
31+
just-format:
32+
#!/usr/bin/env bash
33+
# Find all files named "justfile" recursively and run just --fmt --unstable on them
34+
find . -type f -name "justfile" -print0 | while IFS= read -r -d '' file; do
35+
echo "Formatting $file"
36+
just --fmt --unstable -f "$file"
37+
done

shell.nix

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
pkgs.mkShell {
3+
nativeBuildInputs = with pkgs; [
4+
php
5+
just
6+
];
7+
}

0 commit comments

Comments
 (0)