This repository was archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.sh
executable file
·58 lines (51 loc) · 1.62 KB
/
prepare.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
#!/bin/bash
# Installs some of the required dependencies and tools for the project:
# - notebookinator: typst template for vrc engineering notebook
# - typst-live: provides live preview of compiled typst pdf
# - typstfmt: provides formatting for typst files
# - typos-cli: provides spell checking
#
# Also adds the required fonts to the system from the ./assets/fonts
#
# This script does not install these required tools:
# - git: used to clone notebookinator and update this notebook
# - cargo: used to install typst-live, typstfmt, and typos-cli
# - typst: used to compile typst files
# - just: used to install notebookinator template
# exits with exit code 1 if the command is not found
# borrowed from https://stackoverflow.com/a/7522866
check_command() {
command_name=$1
if ! command_loc="$(type -p "$command_name")" || [[ -z $command_loc ]]; then
return 1
fi
}
if ! check_command git ; then
echo "git is not installed. Please install it"
exit 1
fi
if ! check_command cargo ; then
echo "cargo is not installed. Please install it"
exit 1
fi
if ! check_command typst ; then
echo "typst is not installed. Please install it"
exit 1
fi
if ! check_command just ; then
echo "just is not installed. Please install it"
exit 1
fi
if [ -d "notebookinator" ]; then
echo "notebookinator directory already exists. Skipping clone."
else
git clone https://github.com/darkMatter781x/notebookinator
fi
cd notebookinator
just install
cd ..
cargo install typst-live
cargo install --git https://github.com/astrale-sharp/typstfmt.git --tag 0.2.7
cargo install typos-cli
# add fonts
sudo cp -R ./assets/fonts /usr/share/fonts/truetype