-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move version info into the main file to fix missing files from AUR
- Loading branch information
Showing
4 changed files
with
46 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,52 @@ | ||
#!/bin/bash | ||
|
||
# Step 1: Extract version from src/version.py | ||
VERSION=$(python3 -c "from src.version import __version__; print(__version__)") | ||
if [ -z "$VERSION" ]; then | ||
echo "Failed to extract version from src/version.py" | ||
exit 1 | ||
fi | ||
echo "Extracted version: $VERSION" | ||
# Step 1: Function to extract version from OneDriveGUI.py without importing | ||
get_version() { | ||
FILE_PATH="src/OneDriveGUI.py" | ||
VERSION=$(grep -Po '^__version__\s*=\s*"\K[^\"]+' "$FILE_PATH") | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo "Failed to extract version from $FILE_PATH" | ||
exit 1 | ||
fi | ||
|
||
echo "Extracted version: $VERSION" | ||
} | ||
|
||
# Step 2: Update the indented version line in AppImageBuilder.yml | ||
YAML_FILE="AppImageBuilder.yml" | ||
if [ -f "$YAML_FILE" ]; then | ||
echo "Updating version in $YAML_FILE..." | ||
# Use sed to match the indented version line (e.g., " version: 1.1.0") and update it | ||
sed -i "s/^\(\s\+version:\s\).*/\1$VERSION/" "$YAML_FILE" | ||
echo "Version updated to $VERSION in the indented version line of $YAML_FILE" | ||
else | ||
echo "$YAML_FILE not found." | ||
exit 1 | ||
fi | ||
update_yaml() { | ||
YAML_FILE="AppImageBuilder.yml" | ||
|
||
if [ -f "$YAML_FILE" ]; then | ||
echo "Updating version in $YAML_FILE..." | ||
# Use sed to match the indented version line and update it | ||
sed -i "s/^\(\s\+version:\s\).*/\1$VERSION/" "$YAML_FILE" | ||
echo "Version updated to $VERSION in the indented version line of $YAML_FILE" | ||
else | ||
echo "$YAML_FILE not found." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Step 3: Build the AppImage using appimage-builder | ||
if ! command -v appimage-builder &> /dev/null; then | ||
echo "appimage-builder could not be found. Please install it first." | ||
exit 1 | ||
fi | ||
build_appimage() { | ||
if ! command -v appimage-builder &> /dev/null; then | ||
echo "appimage-builder could not be found. Please install it first." | ||
exit 1 | ||
fi | ||
|
||
echo "Building AppImage..." | ||
appimage-builder --recipe "$YAML_FILE" | ||
echo "Building AppImage..." | ||
appimage-builder --recipe "$YAML_FILE" | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "AppImage build succeeded!" | ||
else | ||
echo "AppImage build failed." | ||
exit 1 | ||
fi | ||
if [ $? -eq 0 ]; then | ||
echo "AppImage build succeeded!" | ||
else | ||
echo "AppImage build failed." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Main script execution | ||
get_version | ||
update_yaml | ||
build_appimage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.