Skip to content

Commit

Permalink
Sanity check macos assets (#165)
Browse files Browse the repository at this point in the history
* added `checkAssetsMacos.sh` to scripts to sanity check machine for macos assets

* cleanup of scripts in `package.json`

- sorted scripts
- merged `clean:git` into `clean:assets:dev`, since there's never reason to run them separately

* added run of `checkAssetsMacos.sh` to end of `make:assets:macos` script

* add comment
  • Loading branch information
telamonian authored Nov 2, 2024
1 parent 36c1234 commit 9553e41
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,36 @@
"main": ".vite/build/main.js",
"packageManager": "[email protected]",
"scripts": {
"test:unit": "jest --config jest.config.js",
"test:e2e": "npx playwright test",
"test:update-snapshots": "npx playwright test --update-snapshots",
"clean": "rimraf .vite dist out",
"clean:assets": "rimraf assets/.env assets/ComfyUI assets/python.tgz & yarn run clean:assets:dev",
"clean:assets:dev": "rimraf assets/python assets/override.txt & rimraf assets/cpython*.tar.gz & rimraf assets/requirements.*",
"clean:assets:dev": "yarn run clean:assets:git && rimraf assets/python assets/override.txt & rimraf assets/cpython*.tar.gz & rimraf assets/requirements.*",
"clean:assets:git": "rimraf assets/ComfyUI/.git assets/ComfyUI/custom_nodes/ComfyUI_Manager/.git assets/ComfyUI/custom_nodes/DesktopSettingsExtension/.git",
"clean:slate": "yarn run clean & yarn run clean:assets & rimraf node_modules",
"lint": "eslint --ext .ts,.tsx .",
"lint:fix": "eslint --fix --ext .ts,.tsx .",
"clone-settings-extension": "git clone https://github.com/Comfy-Org/DesktopSettingsExtension.git assets/ComfyUI/custom_nodes/DesktopSettingsExtension",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"prepare": "husky",
"lint": "eslint --ext .ts,.tsx .",
"lint:fix": "eslint --fix --ext .ts,.tsx .",
"make": "yarn run vite:compile && electron-builder build --config=builder-debug.config.ts",
"make:assets:amd": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --amd --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && yarn run clone-settings-extension",
"make:assets:cpu": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --cpu --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && node ../scripts/env.mjs && yarn run clone-settings-extension",
"make:assets:macos": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --m-series --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && yarn run clone-settings-extension && ../scripts/checkAssetsMacos.sh python",
"make:assets:nvidia": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --nvidia --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && yarn run clone-settings-extension",
"make:nvidia": "yarn run make -- --nvidia",
"make:assets:amd": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --amd --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && yarn run clone-settings-extension && yarn run clean:git",
"make:assets:cpu": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --cpu --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && node ../scripts/env.mjs && yarn run clone-settings-extension && yarn run clean:git",
"make:assets:nvidia": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --nvidia --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && yarn run clone-settings-extension && yarn run clean:git",
"make:assets:macos": "cd assets && comfy-cli --skip-prompt --here install --fast-deps --m-series --manager-url https://github.com/Comfy-Org/manager-core && comfy-cli --here standalone && yarn run clone-settings-extension && yarn run clean:git",
"vite:compile": "vite build --config vite.renderer.config.ts && vite build --config vite.main.config.ts && vite build --config vite.preload.config.ts ",
"notarize": "node debug/notarize.js",
"clone-settings-extension": "git clone https://github.com/Comfy-Org/DesktopSettingsExtension.git assets/ComfyUI/custom_nodes/DesktopSettingsExtension",
"package": "yarn run vite:compile && todesktop build --code-sign=false --async",
"postinstall": "node ./scripts/todesktop/postInstall.js",
"prepare": "husky",
"publish": "yarn run vite:compile && todesktop build --async",
"sign": "node debug/sign.js",
"start": "node ./scripts/launchdev.js",
"typescript": "yarn run tsc",
"todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.js",
"postinstall": "node ./scripts/todesktop/postInstall.js",
"test:e2e": "npx playwright test",
"test:unit": "jest --config jest.config.js",
"test:update-snapshots": "npx playwright test --update-snapshots",
"todesktop:afterPack": "./scripts/todesktop/afterPack.js",
"clean:git": "rm -rf assets/ComfyUI/.git assets/ComfyUI/custom_nodes/ComfyUI_Manager/.git assets/ComfyUI/custom_nodes/DesktopSettingsExtension/.git"
"todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.js",
"typescript": "yarn run tsc",
"vite:compile": "vite build --config vite.renderer.config.ts && vite build --config vite.main.config.ts && vite build --config vite.preload.config.ts"
},
"devDependencies": {
"@electron/fuses": "^1.8.0",
Expand Down
10 changes: 10 additions & 0 deletions scripts/checkAssetsMacos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

for pyexec in "$1/bin/python" "$1/lib/libpython*.dylib"; do
# the grep captures the last word in the output of the file cmd
if [ $(file $pyexec | grep -oE '[^ ]+$') = "x86_64" ]; then
# the leading redirect causes echo to output to stderr
>&2 echo "ERROR: bundled python executable $pyexec is built for incorrect machine (x86_64)"
exit 1
fi
done

0 comments on commit 9553e41

Please sign in to comment.