Move packer installation to workflow instead of neovim
parent
e3301f6240
commit
8f434895b0
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
5
Makefile
5
Makefile
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if require("init.first_load")(os.getenv("FORCE_PACKER_INSTALL") ~= nil) then
|
||||
if require("init.first_load")() then
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue