Skip to content

Commit

Permalink
Merge pull request #1356 from JonasHarnau/master
Browse files Browse the repository at this point in the history
update install_quarto to distinguish arm64 and amd64
  • Loading branch information
jph00 authored Oct 19, 2023
2 parents 7c7abb0 + 775fda8 commit 552b13c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions nbdev/quarto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# %% ../nbs/api/14_quarto.ipynb 3
from __future__ import annotations
import subprocess,sys,shutil,ast,warnings,traceback
from os import system
from os import system, uname
from contextlib import contextmanager

from .config import *
Expand All @@ -29,8 +29,9 @@ def _sprun(cmd):
BASE_QUARTO_URL='https://www.quarto.org/download/latest/'

def _install_linux():
system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-amd64.deb')
system('sudo dpkg -i quarto-linux-amd64.deb && rm quarto-linux-amd64.deb')
machine = 'arm' if uname().machine in ('arm64', 'aarch64', 'armv8', 'armv8l') else 'amd'
system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-{machine}64.deb')
system(f'sudo dpkg -i quarto-linux-{machine}64.deb && rm quarto-linux-{machine}64.deb')

def _install_mac():
system(f'curl -LO {BASE_QUARTO_URL}quarto-macos.pkg')
Expand Down
7 changes: 4 additions & 3 deletions nbs/api/14_quarto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"#|export\n",
"from __future__ import annotations\n",
"import subprocess,sys,shutil,ast,warnings,traceback\n",
"from os import system\n",
"from os import system, uname\n",
"from contextlib import contextmanager\n",
"\n",
"from nbdev.config import *\n",
Expand Down Expand Up @@ -96,8 +96,9 @@
"BASE_QUARTO_URL='https://www.quarto.org/download/latest/'\n",
"\n",
"def _install_linux():\n",
" system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-amd64.deb')\n",
" system('sudo dpkg -i quarto-linux-amd64.deb && rm quarto-linux-amd64.deb')\n",
" machine = 'arm' if uname().machine in ('arm64', 'aarch64', 'armv8', 'armv8l') else 'amd'\n",
" system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-{machine}64.deb')\n",
" system(f'sudo dpkg -i quarto-linux-{machine}64.deb && rm quarto-linux-{machine}64.deb')\n",
" \n",
"def _install_mac():\n",
" system(f'curl -LO {BASE_QUARTO_URL}quarto-macos.pkg')\n",
Expand Down

0 comments on commit 552b13c

Please sign in to comment.