Skip to content

Commit

Permalink
path fixes for relpath, spaces and trailing slashes (#43)
Browse files Browse the repository at this point in the history
This is mostly a fix for windows to make sure path is resolved correctly

Co-authored-by: Michael Sundvick <[email protected]>
  • Loading branch information
johnnychen94 and msundvick authored Sep 11, 2020
1 parent 9fbabcf commit 54f4b1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ jobs:
& julia -e 'using InteractiveUtils; versioninfo()'
& julia-1.0 -e 'using InteractiveUtils; versioninfo()'
& julia-latest -e 'using InteractiveUtils; versioninfo()'
- name: test path with spaces and trailing slashes
run: |
mkdir "test temp"
& python -m jill install latest --confirm --upstream Official --install_dir "test temp"
& julia -e 'using InteractiveUtils; versioninfo()'
& julia-1.0 -e 'using InteractiveUtils; versioninfo()'
& julia-latest -e 'using InteractiveUtils; versioninfo()'
arm_job:
runs-on: ubuntu-18.04
Expand Down
6 changes: 4 additions & 2 deletions jill/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def make_symlinks(src_bin, symlink_dir, version):
if current_system() == "windows":
with open(linkpath, 'w') as f:
# create a cmd file to mimic how we do symlinks in linux
f.writelines(["@echo off\n", f"{src_bin} %*"])
f.writelines(['@echo off\n', f'"{src_bin}" %*'])
else:
os.symlink(src_bin, linkpath)

Expand Down Expand Up @@ -322,7 +322,9 @@ def install_julia(version=None, *,
where you want symlinks(e.g., `julia`, `julia-1`) placed.
"""
install_dir = install_dir if install_dir else default_install_dir()
install_dir = os.path.abspath(install_dir)
symlink_dir = symlink_dir if symlink_dir else default_symlink_dir()
symlink_dir = os.path.abspath(symlink_dir)
system, arch = current_system(), current_architecture()
version = str(version) if (version or str(version) == "0") else ''
version = "latest" if version == "nightly" else version
Expand All @@ -335,7 +337,7 @@ def install_julia(version=None, *,

hello_msg()
if system == "windows":
install_dir = install_dir.replace("\\\\", "\\")
install_dir = install_dir.replace("\\\\", "\\").strip('\'"')
if not confirm:
version_str = version if version else "latest stable release"
question = "jill will:\n"
Expand Down

0 comments on commit 54f4b1a

Please sign in to comment.