Skip to content

Commit

Permalink
inlined the install script
Browse files Browse the repository at this point in the history
  • Loading branch information
Helveg committed Apr 20, 2021
1 parent 02c48a1 commit c6cb574
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
31 changes: 31 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3

import os, sys, shutil, urllib.request, time

if "--local" in sys.argv:
print("Installing local Neuro3D Blender addon.")
shutil.make_archive("neuro3d", 'zip', ".", "neuro3d")
else:
print("Downloading Neuro3D Blender addon.")
archive = "https://github.com/Helveg/neuro3d/releases/latest/download/neuro3d.zip"
with urllib.request.urlopen(archive) as w:
with open("neuro3d.zip", 'wb') as f:
f.write(w.read())
try:
with open("_tmp_n3d_install.py", "w") as f:
f.write("""
import bpy, os
bpy.ops.preferences.addon_install(
filepath=os.path.abspath("neuro3d.zip"), overwrite=True
)
bpy.ops.preferences.addon_enable(module="neuro3d")
bpy.ops.wm.save_userpref()
""")
try:
print("Launching Blender, installing zip.")
os.system(f"blender --background --python _tmp_n3d_install.py")
finally:
os.remove("_tmp_n3d_install.py")
finally:
os.remove("neuro3d.zip")
7 changes: 0 additions & 7 deletions installer/blender_install.py

This file was deleted.

18 changes: 0 additions & 18 deletions installer/install

This file was deleted.

2 changes: 1 addition & 1 deletion neuro3d/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.1"
__version__ = "0.0.3"

import warnings
import numpy as np
Expand Down

0 comments on commit c6cb574

Please sign in to comment.