Skip to content

Commit

Permalink
Create directories recursively + disallow i386
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-van-Tol committed Nov 9, 2023
1 parent 9e32512 commit 5430b9f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/litexcnc/cli/install_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _install_litex(target: str, user: bool) -> int:
target = os.path.join(target, 'litex')

if not os.path.exists(target):
os.mkdir(target)
os.makedirs(target)

# Download the setup file
response = requests.get(
Expand Down Expand Up @@ -60,12 +60,21 @@ def _install_oss_cad_suite(target: str, user: bool, arch: str = None, os_:str =
click.echo(click.style("INFO", fg="blue") + f": Auto-detected architecture {arch}.")

# Check whether the combination if supported by oss-cad-suite
supported = True
if arch == 'i386':
click.echo(click.style("ERROR", fg="red") + f": OSS-Cad-Suite does not support `i386` architecture.")
supported = False
if os_ == 'darwin':
if not arch.lower() in ['arm64', 'x64']:
click.echo(click.style("ERROR", fg="red") + f": Darwin only supports arm64 and x64 as architecture.")
supported = False
if os_ == 'windows':
if not arch.lower() in ['x64']:
click.echo(click.style("ERROR", fg="red") + f": Windows only supports x64 as architecture.")
supported = False
if not supported:
click.echo(click.style("ERROR", fg="red") + f": Please use a different system to build the firmware.")
return

# Download and install the selected files
with tempfile.TemporaryDirectory() as tempdirname:
Expand Down Expand Up @@ -108,6 +117,7 @@ def _install_oss_cad_suite(target: str, user: bool, arch: str = None, os_:str =
# Done!
click.echo(click.style("INFO", fg="blue") + f": OSS-CAD-Suite successfully installed")


def _install_openocd(target: str, user: bool):
"""Installs the OpenOCD for Raspberry Pi"""
click.echo(click.style("INFO", fg="blue") + f": Installing OpenOCD for Raspberry Pi.")
Expand Down

0 comments on commit 5430b9f

Please sign in to comment.