Legacy support #23
24
Makefile
24
Makefile
@@ -1,8 +1,9 @@
|
||||
.PHONY: install run develop clean build build-appimage build-exe dist sync-version wheel node_modules python build-docker run-docker
|
||||
.PHONY: install run develop clean build build-appimage build-exe dist sync-version wheel node_modules python build-docker run-docker electron-legacy build-appimage-legacy build-exe-legacy
|
||||
|
||||
PYTHON ?= python
|
||||
POETRY = $(PYTHON) -m poetry
|
||||
NPM = npm
|
||||
LEGACY_ELECTRON_VERSION ?= 30.0.8
|
||||
|
||||
DOCKER_COMPOSE_CMD ?= docker compose
|
||||
DOCKER_COMPOSE_FILE ?= docker-compose.yml
|
||||
@@ -44,6 +45,27 @@ build-exe: build
|
||||
|
||||
|
|
||||
dist: build-appimage
|
||||
|
||||
electron-legacy:
|
||||
$(NPM) install --no-save electron@$(LEGACY_ELECTRON_VERSION)
|
||||
|
||||
build-appimage-legacy: build electron-legacy
|
||||
$(NPM) run electron-postinstall
|
||||
$(NPM) run dist -- --linux AppImage
|
||||
@set -e; for f in dist/*-linux.AppImage dist/*-linux.deb; do \
|
||||
[ -e "$$f" ] || continue; \
|
||||
dir=$$(dirname "$$f"); base=$$(basename "$$f"); ext=$${base##*.}; name=$${base%.$$ext}; \
|
||||
mv "$$f" "$$dir/$${name}-legacy.$$ext"; \
|
||||
done
|
||||
|
||||
build-exe-legacy: build electron-legacy
|
||||
$(NPM) run electron-postinstall
|
||||
$(NPM) run dist -- --win portable
|
||||
@set -e; for f in dist/*-win-installer.exe dist/*-win-portable.exe; do \
|
||||
[ -e "$$f" ] || continue; \
|
||||
dir=$$(dirname "$$f"); base=$$(basename "$$f"); ext=$${base##*.}; name=$${base%.$$ext}; \
|
||||
mv "$$f" "$$dir/$${name}-legacy.$$ext"; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -rf node_modules
|
||||
rm -rf build
|
||||
|
||||
Reference in New Issue
Block a user
🛠️ Refactor suggestion | 🟠Major
Artifact renaming logic is duplicated between Makefile and workflow; clarify intended usage.
The artifact renaming logic (bash pattern matching to append
-legacysuffix) appears identically in both:The workflow does not invoke these Makefile targets; it runs npm commands directly and performs its own renaming. This duplication complicates maintenance—if the renaming logic needs to change, updates must be made in two places.
Recommendation: If the Makefile targets are meant only for local development, add a comment documenting this. Alternatively, consider extracting the renaming logic into a shared script that both the Makefile and workflow invoke, or remove the Makefile targets if they are unused in the actual CI/CD pipeline.
For now, consider adding a comment above the legacy targets:
Also, consider handling the case where no files match the glob pattern. The workflow uses
shopt -s nullglobto avoid errors if no files match, but the Makefile targets do not. Add the nullglob option to the Makefile loops:Note: The
[ -e "$$f" ]check makes the nullglob redundant, so this is a minor improvement for clarity. The current code is safe.📝 Committable suggestion
🤖 Prompt for AI Agents
âś… Addressed in commits
bf8c22ctod97676a