Move packer installation to workflow instead of neovim
parent
e3301f6240
commit
8f434895b0
|
@ -22,6 +22,8 @@ jobs:
|
||||||
uses: rhysd/action-setup-vim@v1
|
uses: rhysd/action-setup-vim@v1
|
||||||
with:
|
with:
|
||||||
neovim: true
|
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
|
- name: Run neovim checks
|
||||||
run: make check_neovim
|
run: make check_neovim
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -23,6 +23,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
neovim: true
|
neovim: true
|
||||||
version: nightly
|
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
|
- name: Run neovim checks
|
||||||
run: make check_neovim
|
run: make check_neovim
|
||||||
env:
|
env:
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -314,9 +314,10 @@ install_vim: check_os link_vim
|
||||||
|
|
||||||
.PHONY: check_neovim
|
.PHONY: check_neovim
|
||||||
check_neovim: check_os
|
check_neovim: check_os
|
||||||
@echo "Running vim config basic test"
|
@echo "This expects that packer is already installed"
|
||||||
@FORCE_PACKER_INSTALL=1 nvim --headless -c 'autocmd User PackerComplete quitall'
|
@echo "Installing packer packages"
|
||||||
@nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerInstall'
|
@nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerInstall'
|
||||||
|
@echo "Doing a basic neovim startup and quit"
|
||||||
@nvim --headless -c 'quitall'
|
@nvim --headless -c 'quitall'
|
||||||
|
|
||||||
.PHONY: oh_my_zsh
|
.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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
-- Adopted from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/tj/first_load.lua
|
-- Adopted from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/tj/first_load.lua
|
||||||
local download_packer = function(force)
|
local download_packer = function()
|
||||||
if not force then
|
if vim.fn.input("Download Packer? (y for yes)") ~= "y" then
|
||||||
if vim.fn.input("Download Packer? (y for yes)") ~= "y" then
|
return
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath("data"))
|
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("PackerCompile")
|
||||||
vim.api.nvim_command("PackerInstall")
|
vim.api.nvim_command("PackerInstall")
|
||||||
print("( You'll need to restart now )")
|
print("( You'll need to restart now )")
|
||||||
if force then
|
|
||||||
vim.api.nvim_command("quitall")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return function(force)
|
return function()
|
||||||
if not pcall(require, "packer") then
|
if not pcall(require, "packer") then
|
||||||
download_packer(force)
|
download_packer()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue