Automatically installing the latest Quarto version

Viewed 154

I use a Quarto script to render my blog in Python. Quarto frequently updates, and I want to automatically install the latest version so I can have a script that automatically updates Quarto before rendering my blog.

How can I do this?

2 Answers

This is another example leveraging latest github release and gh CLI

gh --repo quarto-dev/quarto-cli release download --pattern '*.deb'
sudo dpkg -i $(ls quarto-*.deb)
rm $(ls quarto-*.deb)

This could be adapted to any repo with Github release.

Using _download.json is the safest though, especially when stable release of Quarto will be out.

For my own blog, I use the script below:

wget https://quarto.org/docs/download/_download.json 
ver=$(grep -o '"version": "[^"]*' _download.json | grep -o '[^"]*$')
wget https://github.com/quarto-dev/quarto-cli/releases/download/v${ver}/quarto-${ver}-linux-amd64.deb
sudo dpkg -i quarto-${ver}-linux-amd64.deb
rm quarto-${ver}-linux-amd64.deb
rm _download.json

It takes advantage of the _download.json file in Quarto's website having the latest version.

Related