diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2024-07-12 11:18:14 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2024-07-12 11:18:14 -0300 |
| commit | ea0f4bf8ffade657b1d45152dbc183d4679e75c4 (patch) | |
| tree | cc1fb023bc308e019ddce33a4b0aed39f56805dc /lua/pi/packer_install.lua | |
| parent | 1fd0af14d592d612c2aaab7717c04c8806ba3daa (diff) | |
| download | nvim-conf-ea0f4bf8ffade657b1d45152dbc183d4679e75c4.tar.gz nvim-conf-ea0f4bf8ffade657b1d45152dbc183d4679e75c4.zip | |
Feat: PI
Diffstat (limited to 'lua/pi/packer_install.lua')
| -rw-r--r-- | lua/pi/packer_install.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lua/pi/packer_install.lua b/lua/pi/packer_install.lua new file mode 100644 index 0000000..9ef6658 --- /dev/null +++ b/lua/pi/packer_install.lua @@ -0,0 +1,27 @@ +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") + + vim.fn.mkdir(directory, "p") + + local out = vim.fn.system( + string.format("git clone %s %s", "https://github.com/wbthomason/packer.nvim", directory .. "/packer.nvim") + ) + + print(out) + print "Downloading packer.nvim..." + print "( You'll need to restart now )" +end + +return function() + if not pcall(require, "packer") then + download_packer() + + return true + end + + return false +end |