mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 11:18:27 +08:00
artiq_flash: fix openocd scripts path (#513)
This commit is contained in:
parent
40a6e87152
commit
a7e101af8d
@ -5,7 +5,7 @@ import argparse
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import site
|
import shutil
|
||||||
|
|
||||||
from artiq import __artiq_dir__ as artiq_dir
|
from artiq import __artiq_dir__ as artiq_dir
|
||||||
from artiq.frontend.bit2bin import bit2bin
|
from artiq.frontend.bit2bin import bit2bin
|
||||||
@ -77,11 +77,12 @@ def main():
|
|||||||
raise SystemExit("Binaries directory '{}' does not exist"
|
raise SystemExit("Binaries directory '{}' does not exist"
|
||||||
.format(opts.dir))
|
.format(opts.dir))
|
||||||
|
|
||||||
conda_prefix_path = site.getsitepackages()[0]
|
scripts_path = ["share", "openocd", "scripts"]
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
scripts_path = os.path.join(conda_prefix_path, "Library", "share", "openocd", "scripts")
|
scripts_path.insert(0, "Library")
|
||||||
else:
|
scripts_path = os.path.abspath(os.path.join(
|
||||||
scripts_path = os.path.join(conda_prefix_path, "share", "openocd", "scripts")
|
os.path.dirname(shutil.which("openocd")),
|
||||||
|
"..", *scripts_path))
|
||||||
|
|
||||||
conv = False
|
conv = False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user