diff options
| author | William Boman <william@redwill.se> | 2022-09-17 22:35:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-17 22:35:38 +0200 |
| commit | d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296 (patch) | |
| tree | 5f5ae4c7b55a90e9522fbaa4a04a1c5ccbafd0d8 /lua/mason-core/managers/pip3/init.lua | |
| parent | feat(editorconfig-checker): use the pre-packaged ec (#434) (diff) | |
| download | mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.tar mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.tar.gz mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.tar.bz2 mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.tar.lz mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.tar.xz mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.tar.zst mason-d7eb2eeec566da6cfd1c61b1d7aa6fc592d1b296.zip | |
feat: more competent platform detection (#436)
Diffstat (limited to 'lua/mason-core/managers/pip3/init.lua')
| -rw-r--r-- | lua/mason-core/managers/pip3/init.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/mason-core/managers/pip3/init.lua b/lua/mason-core/managers/pip3/init.lua index 078f4c3d..ace0b7db 100644 --- a/lua/mason-core/managers/pip3/init.lua +++ b/lua/mason-core/managers/pip3/init.lua @@ -12,7 +12,7 @@ local VENV_DIR = "venv" local M = {} local create_bin_path = _.compose(path.concat, function(executable) - return _.append(executable, { VENV_DIR, platform.is_win and "Scripts" or "bin" }) + return _.append(executable, { VENV_DIR, platform.is.win and "Scripts" or "bin" }) end, _.if_else(_.always(platform.is.win), _.format "%s.exe", _.identity)) ---@param packages string[] @@ -44,7 +44,7 @@ function M.install(packages) pkgs[1] = ("%s==%s"):format(pkgs[1], version) end) - local executables = platform.is_win and _.list_not_nil(vim.g.python3_host_prog, "python", "python3") + local executables = platform.is.win and _.list_not_nil(vim.g.python3_host_prog, "python", "python3") or _.list_not_nil(vim.g.python3_host_prog, "python3", "python") -- pip3 will hardcode the full path to venv executables, so we need to promote cwd to make sure pip uses the final destination path. @@ -161,7 +161,7 @@ end ---@param install_dir string function M.venv_path(install_dir) - return path.concat { install_dir, VENV_DIR, platform.is_win and "Scripts" or "bin" } + return path.concat { install_dir, VENV_DIR, platform.is.win and "Scripts" or "bin" } end return M |
