Fix macOS widget packaging

This commit is contained in:
Kiyomichi Kosaka 2025-06-16 12:58:21 +02:00
parent 9031736f7a
commit db3b93fc1b
2 changed files with 5 additions and 9 deletions

View File

@ -70,8 +70,8 @@ The repository includes a minimal Dashboard widget under
package it automatically: package it automatically:
1. Run `./build-widget.sh` from the repository root. 1. Run `./build-widget.sh` from the repository root.
2. The script creates `CoBiEClock.wdgt` which you can double-click to 2. The script creates a folder `CoBiEClock.wdgt` which you can
install. doubleclick to install on macOS.
The widget runs offline and shows the analog CoBiE clock on your The widget runs offline and shows the analog CoBiE clock on your
desktop. desktop.

View File

@ -4,9 +4,9 @@ set -euo pipefail
WIDGET_NAME="CoBiEClock" WIDGET_NAME="CoBiEClock"
SRC_DIR="macos-widget" SRC_DIR="macos-widget"
BUILD_DIR="build-widget" BUILD_DIR="${WIDGET_NAME}.wdgt"
# Clean build directory # Clean previous build
rm -rf "$BUILD_DIR" rm -rf "$BUILD_DIR"
mkdir "$BUILD_DIR" mkdir "$BUILD_DIR"
@ -16,8 +16,4 @@ cp "$SRC_DIR/Info.plist" "$SRC_DIR/index.html" "$BUILD_DIR/"
# Copy shared files from repository root # Copy shared files from repository root
cp clock.js cobie.js style.css logo.svg "$BUILD_DIR/" cp clock.js cobie.js style.css logo.svg "$BUILD_DIR/"
# Create archive and rename echo "Widget created: ${BUILD_DIR}"
zip -r "${WIDGET_NAME}.zip" "$BUILD_DIR" > /dev/null
mv "${WIDGET_NAME}.zip" "${WIDGET_NAME}.wdgt"
echo "Widget created: ${WIDGET_NAME}.wdgt"