Queer European MD passionate about IT
Переглянути джерело

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

Davte 5 роки тому
батько
коміт
8fcbd5c73d
2 змінених файлів з 14 додано та 3 видалено
  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;