-
Notifications
You must be signed in to change notification settings - Fork 26
/
justfile
70 lines (56 loc) · 1.79 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
build toolchain="": init
cargo {{toolchain}} build
init:
[ -f datasets/modules/spdx-license-list-data/json/details/MIT.json ] || git submodule update --init
# run a Cargo command across all packages
all toolchain="" +cmds="": init
cargo {{toolchain}} {{cmds}}
cd cli && cargo {{toolchain}} {{cmds}}
cd extras/wasm && cargo {{toolchain}} {{cmds}}
lint toolchain="":
just all {{toolchain}} clippy
just all {{toolchain}} fmt
# run the CLI in release mode
# doesn't support rustup toolchain selection
cli +args="": init
cd cli && cargo build --release
./target/release/askalono {{args}}
# test askalono against a license file and show a diff
# doesn't support rustup toolchain selection
diag +args="": init
cd cli && cargo build --release --features diagnostics
./target/release/askalono id --diff {{args}}
# update the gh-pages branch with generated documentation
update-docs toolchain="":
#!/bin/bash
set -euxo pipefail
cargo {{toolchain}} doc --no-deps
rev=$(git rev-parse --short HEAD)
git clone . -b gh-pages gh-pages
cp -rv target/doc/. gh-pages/doc
pushd gh-pages
git add doc
git commit -m "Documentation update from master commit $rev"
git push
popd
# update the wasm-demo stuff
update-wasm-demo:
#!/bin/bash
set -euxo pipefail
rev=$(git rev-parse --short HEAD)
pushd extras/wasm
wasm-pack build --out-name askalono
pushd demo
npm install
rm -rf dist
npm run build
popd
popd
git clone . -b gh-pages gh-pages
rm -rf gh-pages/wasm-demo
cp -rv extras/wasm/demo/dist/. gh-pages/wasm-demo
pushd gh-pages
git add wasm-demo
git commit -m "wasm-demo update from master commit $rev"
git push
popd