Skip to content

Commit 294d461

Browse files
authored
Create postBuild
1 parent 93a3b37 commit 294d461

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

postBuild

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash -v
2+
3+
# determine which version of Quarto to install
4+
QUARTO_VERSION=1.5.28
5+
6+
# See whether we need to lookup a Quarto version
7+
if [ $QUARTO_VERSION = "prerelease" ]; then
8+
QUARTO_JSON="_prerelease.json"
9+
elif [ $QUARTO_VERSION = "release" ]; then
10+
QUARTO_JSON="_download.json"
11+
fi
12+
13+
if [ $QUARTO_JSON != "" ]; then
14+
15+
# create a python script and run it
16+
PYTHON_SCRIPT=_quarto_version.py
17+
if [ -e $PYTHON_SCRIPT ]; then
18+
rm -rf $PYTHON_SCRIPT
19+
fi
20+
21+
cat > $PYTHON_SCRIPT <<EOF
22+
import urllib, json
23+
24+
import urllib.request, json
25+
with urllib.request.urlopen("https://quarto.org/docs/download/${QUARTO_JSON}") as url:
26+
data = json.load(url)
27+
print(data['version'])
28+
29+
EOF
30+
31+
QUARTO_VERSION=$(python $PYTHON_SCRIPT)
32+
rm -rf $PYTHON_SCRIPT
33+
34+
fi
35+
36+
37+
echo
38+
echo Installing Quarto $QUARTO_VERSION
39+
echo
40+
41+
# download and install the deb file
42+
curl -LO https://github.com/quarto-dev/quarto-cli/releases/download/v$QUARTO_VERSION/quarto-$QUARTO_VERSION-linux-amd64.deb
43+
dpkg -x quarto-$QUARTO_VERSION-linux-amd64.deb .quarto
44+
rm -rf quarto-$QUARTO_VERSION-linux-amd64.deb
45+
46+
# get quarto in the path
47+
mkdir -p ~/.local/bin
48+
ln -s ~/.quarto/opt/quarto/bin/quarto ~/.local/bin/quarto
49+
50+
# create the proper pandoc symlink to enable visual editor in Quarto extension
51+
ln -s ~/.quarto/opt/quarto/bin/tools/x86_64/pandoc ~/.quarto/opt/quarto/bin/tools/pandoc
52+
53+
54+
echo
55+
echo Installed Quarto
56+
echo
57+
# install required python packages
58+
python3 -m pip install jupyterlab-quarto==0.1.45
59+
60+
echo
61+
echo Completed
62+
echo

0 commit comments

Comments
 (0)