Move packer installation to workflow instead of neovim

pull/2/head
Ensar Sarajčić 2022-04-28 17:21:55 +02:00
parent e3301f6240
commit 8f434895b0
5 changed files with 13 additions and 13 deletions

View File

@ -22,6 +22,8 @@ jobs:
uses: rhysd/action-setup-vim@v1
with:
neovim: true
- name: Install packer
run: git clone https://github.com/wbthomason/packer.nvim /share/nvim/site/pack/packer/start/packer.nvim
- name: Run neovim checks
run: make check_neovim
env:

View File

@ -23,6 +23,8 @@ jobs:
with:
neovim: true
version: nightly
- name: Install packer
run: git clone https://github.com/wbthomason/packer.nvim /share/nvim/site/pack/packer/start/packer.nvim
- name: Run neovim checks
run: make check_neovim
env:

View File

@ -314,9 +314,10 @@ install_vim: check_os link_vim
.PHONY: check_neovim
check_neovim: check_os
@echo "Running vim config basic test"
@FORCE_PACKER_INSTALL=1 nvim --headless -c 'autocmd User PackerComplete quitall'
@echo "This expects that packer is already installed"
@echo "Installing packer packages"
@nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerInstall'
@echo "Doing a basic neovim startup and quit"
@nvim --headless -c 'quitall'
.PHONY: oh_my_zsh

View File

@ -1,4 +1,4 @@
if require("init.first_load")(os.getenv("FORCE_PACKER_INSTALL") ~= nil) then
if require("init.first_load")() then
return
end

View File

@ -1,9 +1,7 @@
-- Adopted from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/tj/first_load.lua
local download_packer = function(force)
if not force then
if vim.fn.input("Download Packer? (y for yes)") ~= "y" then
return
end
local download_packer = function()
if vim.fn.input("Download Packer? (y for yes)") ~= "y" then
return
end
local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath("data"))
@ -19,14 +17,11 @@ local download_packer = function(force)
vim.api.nvim_command("PackerCompile")
vim.api.nvim_command("PackerInstall")
print("( You'll need to restart now )")
if force then
vim.api.nvim_command("quitall")
end
end
return function(force)
return function()
if not pcall(require, "packer") then
download_packer(force)
download_packer()
return true
end