-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.sh
executable file
·67 lines (53 loc) · 1.48 KB
/
cli.sh
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
#!/usr/bin/env bash
set -euo pipefail
shopt -s extglob globstar
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
check_all() {
deno check ./**/*.ts
}
code_quality() {
echo "Checking formatting..."
deno fmt --check
echo "Checking types..."
"$0" check_all
echo "Linting..."
deno lint
echo "Running eslint..."
eslint .
}
auto_fmt() {
deno fmt
}
update_lock() {
rm -f deno.lock
deno cache --reload "${SCRIPT_DIR}"/src/deps.ts "${SCRIPT_DIR}"/src/app.ts --lock ./deno.lock --frozen=false
}
update_deps() {
deno run -A jsr:@wok/[email protected] update "$@"
"$0" update_lock
}
run() {
export JETSKI_ENABLE_STACKTRACE=${JETSKI_ENABLE_STACKTRACE:-"0"}
deno run -A --check "${SCRIPT_DIR}"/src/app.ts "$@"
}
set_version() {
local VERSION=${1:-"0.0.0"}
local JSR_JSON
JSR_JSON=$(jq -e --arg VERSION "${VERSION}" '.version=$VERSION' ./deno.json)
echo "${JSR_JSON}" >./deno.json
}
jsr_publish() {
deno publish --config ./deno.json --allow-slow-types --allow-dirty
}
create_release() {
local RELEASE_VERSION=${1:?"Release version is required"}
local RELEASE_BRANCH="releases/${RELEASE_VERSION}"
git config --global user.email "[email protected]"
git config --global user.name "CI Runner"
git checkout -b "${RELEASE_BRANCH}"
git add ./deno.json
git commit -m "Release ${RELEASE_VERSION}"
git push origin "${RELEASE_BRANCH}"
gh release create "${RELEASE_VERSION}" --title "Release ${RELEASE_VERSION}" --notes "" --target "${RELEASE_BRANCH}"
}
"$@"