-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.mog
More file actions
101 lines (84 loc) · 1.67 KB
/
Copy path.mog
File metadata and controls
101 lines (84 loc) · 1.67 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import (
src as up
)
v_path = [which v]
version = [cat v.mod | grep version | cut -d ":" -f 2 | xargs]
kernel = [uname -s | tr "[:upper:]" "[:lower:]"]
arch = [uname -m | tr "[:upper:]" "[:lower:]" | sed -e 's/aarch64/arm64/g' -e 's/x86_64/amd64/g']
upload_path = ./release/mog_{kernel}_{arch}
default:
{fmt}
@desc(run mog, this is kinda circular)
run:
v run .
@desc(run mog with debug output)
run_trace:
v -d trace_logs run .
b:
{build}
@desc(build mog into an executable)
build:
mkdir -p release && v -prod -o release/mog . && echo built
@desc(check if code can be compiled successfully)
check:
v -check . && echo code is good
@desc(format mog code to v standards)
fmt:
v fmt . -w
commit:
git add -A
git commit -m "{$@}"
git push
c:
{commit}
amend:
git add -A
if [ {$#} -eq 0 ]; then
git commit --amend --no-edit
else
output=()
for arg in {$"@"}; do
output+=( "-m $arg" )
done
git commit --amend "${output[@]}"
fi
git push -f
a:
{amend}
tag:
git tag {version}
git push origin --tags
release:
cp ./release/mog {upload_path}
if [[ {$1} == "" ]]; then
gh release create {version} {upload_path}
else
gh release upload --clobber {version} {upload_path}
fi
@desc(for testing)
test:
echo {version}
echo {$bold}{v_path}{$normal_intensity}
{up.test}
sleep 2
echo {$dim}{$1}
echo Enter your name
read name
echo {$normal_intensity}hello ${name}
echo {$green}${EDITOR}
hogwash {$silence_out_err} || echo no hogwash
test2:
echo {kernel}
echo {arch}
test3:
{up.test3} "a thing"
echo {up.val}
echo {$#}
echo {$@}
echo {$"@"}
echo {$*}
echo {$"*"}
for arg in {$"@"}; do
echo "- ${arg}"
done
pwd