Queer European MD passionate about IT
Parcourir la source

Script to update image-editor submodule and copy its `src` to `static`

Davte il y a 5 ans
Parent
commit
8fcbd5c73d
2 fichiers modifiés avec 14 ajouts et 3 suppressions
  1. 3 3
      dynamic/app.py
  2. 11 0
      update_image_editor.sh

+ 3 - 3
dynamic/app.py

@@ -87,8 +87,8 @@ async def pull_image_editor_project(request):
     """Git pull at request."""
     try:
         _subprocess = await asyncio.create_subprocess_shell(
-            'bash {path}/pull_image_editor.sh'.format(
-                path=path
+            'bash {path}/update_image_editor.sh'.format(
+                path=os.path.dirname(path)
             )
         )
         stdout, stderr = await _subprocess.communicate()
@@ -103,7 +103,7 @@ async def pull_image_editor_project(request):
     return web.Response(
         status=302,
         headers={
-            'location': 'https://www.davte.it/michele/image-editor/src/',
+            'location': 'https://michele.davte.it/image-editor/',
         },
     )
 

+ 11 - 0
update_image_editor.sh

@@ -0,0 +1,11 @@
+# Get current directory
+this_script_directory=$(cd `dirname $0` && pwd);
+
+# Update git submodules merging remote version into local one
+git submodule update --remote --merge;
+
+# Delete the outdated folder
+rm -r $this_script_directory/static/image-editor;
+
+# Copy the updated folder
+cp -r $this_script_directory/image-editor/src $this_script_directory/static/image-editor;