forked from quarto-dev/quarto-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure-linux.sh
executable file
·56 lines (42 loc) · 1.27 KB
/
configure-linux.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
#!/bin/bash
source configuration
# Ensure directory is there for Deno
echo "Bootstrapping Deno..."
pushd $QUARTO_PACKAGE_DIR
rm -rf $QUARTO_DIST_DIR
if [ ! -d "$QUARTO_DIST_DIR" ]; then
mkdir -p $QUARTO_DIST_DIR
fi
pushd $QUARTO_DIST_DIR
## Binary Directory
if [ ! -d "$QUARTO_BIN_DIR" ]; then
mkdir -p "$QUARTO_BIN_DIR"
fi
pushd $QUARTO_BIN_DIR
# Download Deno
DENOURL=https://github.com/denoland/deno/releases/download/
DENOFILE=deno-x86_64-unknown-linux-gnu.zip
wget -q --show-progress -O $DENOFILE $DENOURL/$DENO/$DENOFILE
unzip -o $DENOFILE
rm $DENOFILE
# If a canary commit is provided, upgrade to that
if [ ! -z "$DENO_CANARY_COMMIT" ]; then
echo [Upgrading Deno to Canary]
./deno upgrade --canary --version $DENO_CANARY_COMMIT
fi
./deno cache --reload ../../../src/quarto.ts --unstable --importmap=../../../src/import_map.json
popd
popd
popd
pushd $QUARTO_PACKAGE_DIR/src/
# Run the configure command to bootstrap installation
./quarto-bld configure --log-level info
popd
# Run the quarto command with 'reload', which will force the import_map dependencies
# to be reloaded
if ! quarto_loc="$(type -p quarto)" || [[ -z $quarto_loc ]]; then
echo "Quarto symlink doesn't appear to be configured."
else
export QUARTO_DENO_EXTRA_OPTIONS="--reload"
quarto --version
fi