-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
55 lines (34 loc) · 1.13 KB
/
justfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
rootdir := ''
prefix := '/usr'
debug := '0'
export NAME := 'cosmic-ext-applet-external-monitor-brightness'
export APPID := 'io.github.maciekk64.CosmicExtAppletExternalMonitorBrightness'
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
bin-src := cargo-target-dir / if debug == '1' { 'debug' / NAME } else { 'release' / NAME }
base-dir := absolute_path(clean(rootdir / prefix))
bin-dst := base-dir / 'bin' / NAME
desktop-dst := base-dir / 'share' / 'applications' / APPID + '.desktop'
default: build-release
build-debug *args:
cargo build {{args}}
build-release *args:
cargo build --release {{args}}
install:
install -Dm0755 {{bin-src}} {{bin-dst}}
install -Dm0644 res/desktop_entry.desktop {{desktop-dst}}
uninstall:
rm {{bin-dst}}
clean:
cargo clean
################### Test / Format
pull: fmt prettier fix test
test:
cargo test --workspace --all-features
fix:
cargo clippy --workspace --all-features --fix --allow-dirty --allow-staged
fmt:
cargo fmt --all
prettier:
# install on Debian: sudo snap install node --classic
# npx is the command to run npm package, node is the runtime
npx prettier -w .