diff --git a/misc/create_app_bundle.sh b/misc/create_app_bundle.sh index 762b264..b955022 100755 --- a/misc/create_app_bundle.sh +++ b/misc/create_app_bundle.sh @@ -1,12 +1,12 @@ #!/bin/bash +# 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" BINARY_NAME="czkawka_gui" -# Get the directory of the current script (works even if the script is called from another location) -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - # Step 1: Build the project cargo build --release --manifest-path="$DIR/../Cargo.toml" --bin $BINARY_NAME @@ -15,11 +15,12 @@ mkdir -p "$BUNDLE_PATH/Contents/MacOS" mkdir -p "$BUNDLE_PATH/Contents/Resources" # Step 3: Copy the binary -cp "$DIR/../target/release/$BINARY_NAME" "$BUNDLE_PATH/Contents/MacOS/" +cp "$PARENT_DIR/target/release/$BINARY_NAME" "$BUNDLE_PATH/Contents/MacOS/" # Step 4: Copy the icon and rename as .icns (macOS icon format) -# Note: If you have the icon in .icns format use that directly -cp "$DIR/../data/icons/com.github.qarmin.czkawka.svg" "$BUNDLE_PATH/Contents/Resources/Czkawka.icns" +# 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 5: Create the Info.plist file cat <"$BUNDLE_PATH/Contents/Info.plist" @@ -30,7 +31,7 @@ cat <"$BUNDLE_PATH/Contents/Info.plist" CFBundleExecutable $BINARY_NAME CFBundleIconFile - Czkawka.icns + $ICON_NAME CFBundleIdentifier com.github.qarmin.czkawka CFBundleName @@ -43,4 +44,4 @@ cat <"$BUNDLE_PATH/Contents/Info.plist" EOF -echo "Application bundle created at: $BUNDLE_PATH" +echo "Application bundle created at: $BUNDLE_PATH" \ No newline at end of file