Fix linux install

This commit is contained in:
Doyle 2023-02-14 12:17:33 +11:00
parent 8fbc77e2b9
commit 61d20e5262
2 changed files with 17 additions and 7 deletions

View File

@ -1065,6 +1065,7 @@ def get_manifest(is_windows):
download_checksum = ""
exe_path = ""
checksum = ""
symlink = []
if is_windows:
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/nvim-win64.zip"
@ -1076,6 +1077,7 @@ def get_manifest(is_windows):
download_url = f"https://github.com/neovim/neovim/releases/download/v{version}/{exe_path}"
download_checksum = "bb0d4599cb506fc6e29bf0e9cef3b52e06dcb4bb930b56d6eb88320f1d46a908"
checksum = download_checksum
symlink = ["nvim", "vim"] # Usually use VM with no desktop-environment
result.append({
"label": "NVim",
@ -1087,7 +1089,7 @@ def get_manifest(is_windows):
"executables": [
{
"path": exe_path,
"symlink": [],
"symlink": symlink,
"add_to_devenv_path": True,
"checksum": checksum,
}
@ -1325,8 +1327,8 @@ def get_manifest(is_windows):
checksum = "702eb951e6b37be64cca66da976e0fcb0be587121034c1d6f841ce7fad3bd8e3"
exe_path = "fd"
add_to_devenv_script = [
"FZF_DEFAULT_OPTS=--multi --layout=reverse",
"FZF_DEFAULT_COMMAND=fd --type f --strip-cwd-prefix --hidden --follow --exclude .git --exclude .cache --exclude .vs",
"FZF_DEFAULT_OPTS=\"--multi --layout=reverse\"",
"FZF_DEFAULT_COMMAND=\"fd --type f --strip-cwd-prefix --hidden --follow --exclude .git --exclude .cache --exclude .vs\"",
]

View File

@ -381,6 +381,10 @@ def download_and_install_archive(download_url,
label=label,
version_label=version_label,
exe_rel_path=exe_rel_path)
# Make them executable
# ----------------------------------------------------------------------
if not is_windows:
subprocess.run(args=["chmod", "+x", exe_path])
# If you install the Linux manifest on Windows then we ensure we
# still call link (e.g. hardlink) because symlinks need special
@ -426,7 +430,7 @@ def download_and_install_archive(download_url,
if is_windows:
devenv_script_buffer += f"set PATH=%~dp0{path};%PATH%\n"
else:
devenv_script_buffer += f"PATH=$( cd -- \"$( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd ){path}\";%PATH%\n"
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/{path}\":$PATH\n"
# Search the 2 dictionarries, 'first' and 'second' for the key. A matching key
# in 'first' taking precedence over the 'second' dictionary. If no key is
@ -750,9 +754,10 @@ def run(user_app_list,
exit(f'Path "{path}" is not a directory, script can not proceed. Exiting.')
global devenv_script_buffer
devenv_script_buffer = """@echo off
if is_windows:
devenv_script_buffer = """@echo off
"""
"""
# Validate all the manifests before starting
internal_app_validate_result = validate_app_list(internal_app_list)
@ -770,7 +775,10 @@ def run(user_app_list,
is_windows=is_windows)
# Write the devenv script with environment variables
devenv_script_buffer += "set PATH=%~dp0Symlinks;%PATH%\n"
if is_windows:
devenv_script_buffer += "set PATH=%~dp0Symlinks;%PATH%\n"
else:
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Symlinks\":$PATH\n"
devenv_script_name = f"{devenv_script_name}.bat" if is_windows else f"{devenv_script_name}.sh"
devenv_script_path = pathlib.Path(install_dir, devenv_script_name)