Skip to content

Commit 39ad87c

Browse files
authored
Merge pull request #18 from Abstract-IDE/main
[setup.py] setup packer using installation script
2 parents a41af4e + cc31dc3 commit 39ad87c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

setup.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ def compile_nvim():
142142
# -------------------------------
143143

144144

145+
# -------------------------------
146+
def setup_packer():
147+
nvim_plugin_dir = str(f"{HOME}/.local/share/nvim/site/pack/packer/start")
148+
packer_dir = nvim_plugin_dir+"/packer.nvim"
149+
if not Path(packer_dir).exists():
150+
print("\nsetting up packer...")
151+
if not Path(nvim_plugin_dir).exists():
152+
Path(nvim_plugin_dir).mkdir(parents=True)
153+
154+
repository = "https://github.com/wbthomason/packer.nvim"
155+
subprocess.run(["git", "clone", "--depth", "1", repository], cwd=nvim_plugin_dir)
156+
# -------------------------------
157+
158+
145159
# -------------------------------
146160
def remove_no_require():
147161
subprocess.run(["rm", "-rf", ".git*", "LICENSE", "README.md", "setup.py", ".__*"],
@@ -191,6 +205,7 @@ def main():
191205

192206
# compile configs
193207
try:
208+
setup_packer()
194209
print("\ncompiling config and plugins...")
195210
subprocess.run(["git", "checkout", "release-0.7"], cwd=NVIM_CONF_PATH)
196211
compile_nvim()

0 commit comments

Comments
 (0)