Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation from full URL fails on windows #1267

Open
adigitoleo opened this issue Feb 10, 2024 · 0 comments
Open

installation from full URL fails on windows #1267

adigitoleo opened this issue Feb 10, 2024 · 0 comments
Labels
bug v1 An issue or PR relevant to packer v2

Comments

@adigitoleo
Copy link

  • nvim --version: NVIM v0.9.5, Build type: RelWithDebInfo, LuaJIT 2.1.1703942320
  • git --version: git version 2.43.0.windows.1
  • Operating system/version: Windows 11 Home 23H2
  • Terminal name/version: PowerShell 7.4.1

Steps to reproduce

Attempt to install a package from a full URL (e.g. https://git.sr.ht/~adigitoleo/overview.nvim).

local fn = vim.fn

local function bootstrap()
    local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
    if fn.empty(fn.glob(install_path)) > 0 then
        fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
        vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' .. vim.o.runtimepath
        vim.cmd [[packadd packer.nvim]]
        return true
    end
    return false
end
local packer_bootstrap = bootstrap()

require("packer").startup(function(use)
    -- use "adigitoleo/overview.nvim"  -- THIS WORKS (github mirror)
    use "https://git.sr.ht/~adigitoleo/overview.nvim"  -- THIS DOESN'T
    if packer_bootstrap then
        require("packer").sync()
    end
end)

Actual behaviour

Pakcer fails to create the "leading directories" under AppData\Local because it attempts to use the full URL as the directory name.

Expected behaviour

Installation succeeds.

Notes

Using the full URL works fine on Linux, so I'm guessing this is related to how the directory creation command is constructed on Windows only.

@adigitoleo adigitoleo added bug v1 An issue or PR relevant to packer v2 labels Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v1 An issue or PR relevant to packer v2
Projects
None yet
Development

No branches or pull requests

1 participant