Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .jupyterlite.doit.db
Binary file not shown.
2 changes: 1 addition & 1 deletion praxis/web-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build:all": "npm run jupyterlite:build && ng build",
"build": "ng build",
"build:browser": "ng build --configuration=browser",
"build:gh-pages": "ng build --configuration=gh-pages && cp src/assets/jupyterlite/jupyter-lite.gh-pages.json dist/web-client/browser/assets/jupyterlite/jupyter-lite.json",
"build:gh-pages": "ng build --configuration=gh-pages && python3 ../../scripts/patch_jupyterlite_config.py dist/web-client/browser/assets/jupyterlite/jupyter-lite.json /praxis/assets/jupyterlite/",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"generate-api": "node node_modules/openapi-typescript-codegen/bin/index.js --input ./src/assets/api/openapi.json --output ./src/app/core/api-generated --client fetch --useUnionTypes --request ./src/app/core/http/custom-request.ts",
Expand Down
35 changes: 35 additions & 0 deletions scripts/patch_jupyterlite_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import json
import sys
import os

def patch_config(file_path, base_url):
print(f"Patching {file_path} with baseUrl={base_url}")

if not os.path.exists(file_path):
print(f"Error: File {file_path} does not exist.")
sys.exit(1)

try:
with open(file_path, 'r') as f:
data = json.load(f)

if 'jupyter-config-data' not in data:
data['jupyter-config-data'] = {}

data['jupyter-config-data']['baseUrl'] = base_url

with open(file_path, 'w') as f:
json.dump(data, f, indent=2)

print("Successfully patched configuration.")

except Exception as e:
print(f"Error patching file: {e}")
sys.exit(1)

if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: python patch_jupyterlite_config.py <path_to_jupyter_lite.json> <base_url>")
sys.exit(1)

patch_config(sys.argv[1], sys.argv[2])