diff --git a/misc/create_app_bundle.sh b/misc/create_app_bundle.sh index b955022..70cf611 100755 --- a/misc/create_app_bundle.sh +++ b/misc/create_app_bundle.sh @@ -2,10 +2,13 @@ # Get the directory of the current script (works even if the script is called from another location) DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PARENT_DIR="$(dirname "$DIR")" - BUNDLE_NAME="Czkawka.app" -BUNDLE_PATH="$DIR/../target/release/$BUNDLE_NAME" +# Simplify the bundle path using cd and pwd +BUNDLE_PATH=$(cd "$DIR/../target/release" && pwd)/$BUNDLE_NAME + BINARY_NAME="czkawka_gui" +# Extract version from Cargo.toml +VERSION=$(grep '^version = ' "$PARENT_DIR/$BINARY_NAME/Cargo.toml" | head -n 1 | cut -d '"' -f 2) # Step 1: Build the project cargo build --release --manifest-path="$DIR/../Cargo.toml" --bin $BINARY_NAME @@ -17,10 +20,12 @@ mkdir -p "$BUNDLE_PATH/Contents/Resources" # Step 3: Copy the binary cp "$PARENT_DIR/target/release/$BINARY_NAME" "$BUNDLE_PATH/Contents/MacOS/" -# Step 4: Copy the icon and rename as .icns (macOS icon format) -# Replace 'myicon.icns' with the actual name of your .icns file -ICON_NAME="Czkawka.icns" -cp "$PARENT_DIR/data/icons/com.github.qarmin.czkawka.svg" "$BUNDLE_PATH/Contents/Resources/$ICON_NAME" +# Step 4: Create and copy the icon and rename as .icns (macOS icon format) +# Assuming the icon file is named correctly and located in the correct directory + + +ICON_NAME="com.github.qarmin.czkawka.icns" +cp "$PARENT_DIR/data/icons/$ICON_NAME" "$BUNDLE_PATH/Contents/Resources/" # Step 5: Create the Info.plist file cat <"$BUNDLE_PATH/Contents/Info.plist" @@ -31,17 +36,17 @@ cat <"$BUNDLE_PATH/Contents/Info.plist" CFBundleExecutable $BINARY_NAME CFBundleIconFile - $ICON_NAME + com.github.qarmin.czkawka CFBundleIdentifier com.github.qarmin.czkawka CFBundleName Czkawka CFBundleVersion - 1.0.0 + $VERSION CFBundlePackageType APPL EOF -echo "Application bundle created at: $BUNDLE_PATH" \ No newline at end of file +echo "Application bundle created at: $BUNDLE_PATH"