From 9a7f1524ac066dfbc16308b03c3982d48b04b300 Mon Sep 17 00:00:00 2001 From: dtf <826902+dtf0@users.noreply.github.com> Date: Sat, 6 Jun 2026 08:00:35 +0000 Subject: [PATCH 1/4] Update check for Python `command -v` is preferred over `type` for this purpose and is POSIX-specified for the exit-status check. Reason for fix: I don't have `python` installed on my path, but it is aliased to `python3`. Script was failing to load webserver after building. --- run_server.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/run_server.sh b/run_server.sh index d7747ac..fa19a7b 100755 --- a/run_server.sh +++ b/run_server.sh @@ -25,9 +25,9 @@ if [ ! -z ${2} ]; then PORT="${2}" fi -# check for python, 'which' will exit with 1 if it doesn't exist, which is stored in ${?} -type python &> /dev/null -if [ "1" = "${?}" ]; then +# check for python -- command -v exits non-zero if the executable isn't on PATH. +PYTHON="$(command -v python3 || command -v python)" +if [ -z "${PYTHON}" ]; then echo "Python isn't installed or accessible, can't host web server." echo "Install it via something like apt on linux, homebrew on macos, or cygwin on windows" exit 1 @@ -44,5 +44,4 @@ echo echo "http://localhost:${PORT}/" echo -cd "${HOST_DIR}" && python -m http.server "${PORT}" - +cd "${HOST_DIR}" && "${PYTHON}" -m http.server "${PORT}" From e912a4ae550d913306cbe6cff7043a5b1c9f0427 Mon Sep 17 00:00:00 2001 From: dtf <826902+dtf0@users.noreply.github.com> Date: Sat, 6 Jun 2026 08:10:12 +0000 Subject: [PATCH 2/4] Fix gallery directory in config Took a little digging (tried updating the file path on `console.log("Fetching json file: " + file);` in `CCUtil.js` first), but found where it actually gets called at the top-level config. Reason for fix: failed to fetch `gallery-index.json` and images. --- src/web/js/CCGalleryConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/js/CCGalleryConfig.js b/src/web/js/CCGalleryConfig.js index 273aa9b..83988ac 100644 --- a/src/web/js/CCGalleryConfig.js +++ b/src/web/js/CCGalleryConfig.js @@ -40,7 +40,7 @@ export class CCAdvancedConfig { galleryJSONFile = "gallery.json" galleryIndexJSONFile = "gallery-index.json" centeredBigImageYOffset = 0; - galleryUrlPrefix = "gallery" + galleryUrlPrefix = "../gallery" gallerySpecificRowHeightsPixels = {}; showGithubLink = false; constructor() { From b15313aebffda35f73bbc7bc08a6a77d5a52ebea Mon Sep 17 00:00:00 2001 From: dtf <826902+dtf0@users.noreply.github.com> Date: Sat, 6 Jun 2026 09:46:57 +0000 Subject: [PATCH 3/4] Revert to default gallery path --- src/web/js/CCGalleryConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/js/CCGalleryConfig.js b/src/web/js/CCGalleryConfig.js index 83988ac..273aa9b 100644 --- a/src/web/js/CCGalleryConfig.js +++ b/src/web/js/CCGalleryConfig.js @@ -40,7 +40,7 @@ export class CCAdvancedConfig { galleryJSONFile = "gallery.json" galleryIndexJSONFile = "gallery-index.json" centeredBigImageYOffset = 0; - galleryUrlPrefix = "../gallery" + galleryUrlPrefix = "gallery" gallerySpecificRowHeightsPixels = {}; showGithubLink = false; constructor() { From e6fcbcdebca16120fa92e961bcb64eec2d842d68 Mon Sep 17 00:00:00 2001 From: dtf <826902+dtf0@users.noreply.github.com> Date: Sat, 6 Jun 2026 09:47:56 +0000 Subject: [PATCH 4/4] Fix build_example_gallery path to gallery --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd6f98f..a112019 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "npm run build_example_gallery && npm run build_web && npm run start_web_server", "build_web": "./build_web.sh", - "build_example_gallery": "node src/BuildGallery.js example-images dist/gallery", + "build_example_gallery": "node src/BuildGallery.js example-images dist/web/gallery", "start_web_server": "./run_server.sh dist/" }, "dependencies": {