-
Notifications
You must be signed in to change notification settings - Fork 432
Expand file tree
/
Copy pathpostinst
More file actions
51 lines (42 loc) · 1.13 KB
/
postinst
File metadata and controls
51 lines (42 loc) · 1.13 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
#!/usr/bin/env bash
set -e
# detect whether running as root (per machine installation)
# if per machine (run without sudo):
if [[ $EUID -eq 0 ]]; then
if [ -d "/usr/local/bin" ]
then
ln -fs /opt/quarto/bin/quarto /usr/local/bin/quarto
else
echo "Quarto symlink not created, please be sure that you add Quarto to your path."
fi
if [ -d "/usr/local/man/man1" ]
then
ln -fs /opt/quarto/share/man/quarto.man /usr/local/man/man1/quarto.1
elif [ -d "/usr/local/man" ]
then
ln -fs /opt/quarto/share/man/quarto.man /usr/local/man/quarto.1
fi
else
if [ -d "~/bin/quarto" ]
then
ln -fs /opt/quarto/bin/quarto ~/bin/quarto
else
echo "Quarto symlink not created, please be sure that you add Quarto to your path."
fi
if [ -d "~/man/man1" ]
then
ln -fs /opt/quarto/share/man/quarto.man ~/man/man1/quarto.1
elif [ -d "~/man" ]
then
ln -fs /opt/quarto/share/man/quarto.man ~/man/quarto.1
fi
fi
# Figure architecture
NIXARCH=$(uname -m)
if [[ $NIXARCH == "aarch64" ]]; then
ARCH_DIR=aarch64
else
ARCH_DIR=x86_64
fi
ln -fs /opt/quarto/bin/tools/${ARCH_DIR}/pandoc /opt/quarto/bin/tools/pandoc
exit 0