-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
80 lines (59 loc) · 1.72 KB
/
justfile
File metadata and controls
80 lines (59 loc) · 1.72 KB
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
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env -S just --justfile
# Powershell is just better/more flexible for this kind
# of stuff than bash IMO Sorry to anyone who is offended.
# --| Cross platform shebang ----------
# --|----------------------------------
shebang := if os() == 'windows' {
'pwsh.exe'
} else {
'/usr/bin/env -S pwsh -noprofile -nologo'
}
# set shell := ["/usr/bin/env", "pwsh" ,"-noprofile", "-nologo", "-c"]
set windows-shell := ["pwsh.exe","-NoLogo", "-noprofile", "-c"]
build := './scripts/build.ps1'
# --| Actions -------------------------
# --|----------------------------------
torch source='term':
just _torch-{{os()}} {{source}}
_torch-linux source:
#!{{shebang}}
. {{build}}
GetTorch {{source}}
# --| Test ------------------
# --|------------------------
test run debug='no':
just _test-{{os()}} {{run}} {{debug}}
_test-linux run debug:
#!{{shebang}}
cargo test
_test-windows run debug:
# Do Windows Things
# --| Build -----------------
# --|------------------------
build source='term':
just torch {{source}}
just _build-{{os()}} {{source}}
_build-linux source:
#!{{shebang}}
. {{build}}
RunBuild {{source}}
_build-windows source:
# Do Windows Things
#!{{shebang}}
# . {{build_steps}}
# RunBuild {{run}}
# --| Run -------------------
# --|------------------------
run source='term':
just build {{source}}
just _run-{{os()}} {{source}}
_run-linux source:
#!{{shebang}}
if (Test-Path -Path $HOME/libtorch) {
$LIBTORCH = $env:LIBTORCH = "$HOME/libtorch"
$env:LD_LIBRARY_PATH="${LIBTORCH}/lib:$env:LD_LIBRARY_PATH"
./target/debug/vectorizer -p /mnt/x/GitHub/fubark/cyber/test -e=cy --index
}
on-save file:
./target/debug/vectorizer -p {{file}} --upload
write-host "Upload Complete."