fix version
This commit is contained in:
parent
17335c598c
commit
d8bc103351
|
@ -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 <<EOF >"$BUNDLE_PATH/Contents/Info.plist"
|
||||
|
@ -31,17 +36,17 @@ cat <<EOF >"$BUNDLE_PATH/Contents/Info.plist"
|
|||
<key>CFBundleExecutable</key>
|
||||
<string>$BINARY_NAME</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>$ICON_NAME</string>
|
||||
<string>com.github.qarmin.czkawka</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.github.qarmin.czkawka</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Czkawka</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.0</string>
|
||||
<string>$VERSION</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
echo "Application bundle created at: $BUNDLE_PATH"
|
||||
echo "Application bundle created at: $BUNDLE_PATH"
|
||||
|
|
Loading…
Reference in a new issue