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;