1+ #! /bin/bash
2+
3+ # Make sure you have jq installed AND be on the folder where 'adnauseam.chromium' is located
4+
5+ # Path to the adnauseam.chromium directory
6+ EXTENSION_DIR=" adnauseam.chromium"
7+
8+ # Path to the manifest.json file
9+ MANIFEST_FILE=" $EXTENSION_DIR /manifest.json"
10+
11+ # Check if the directory exists
12+ if [ -d " $EXTENSION_DIR " ]; then
13+ # Get the current version from the manifest file
14+ CURRENT_VERSION=$( jq -r .version " $MANIFEST_FILE " )
15+ CURRENT_VERSION=" v$CURRENT_VERSION "
16+ echo " Current version: $CURRENT_VERSION "
17+
18+ # Replace URL with the actual URL you want to use
19+ URL=" https://api.github.com/repos/dhowe/AdNauseam/releases/latest"
20+
21+ # Get the latest release information using curl and jq
22+ LATEST_RELEASE=$( curl -s " $URL " | jq -r ' .tag_name' )
23+
24+ # Check if the latest version is different from the current version
25+ if [ " $LATEST_RELEASE " != " $CURRENT_VERSION " ]; then
26+ echo " Updating AdNauseam extension..."
27+
28+ # Download and extract the latest release
29+ curl -L -o " $EXTENSION_DIR .zip" " https://github.com/dhowe/AdNauseam/releases/download/$LATEST_RELEASE /adnauseam.chromium.zip"
30+ unzip -q " $EXTENSION_DIR .zip" -d " ./"
31+ rm " $EXTENSION_DIR .zip"
32+
33+ echo " Update complete. Installed version: $LATEST_RELEASE "
34+ else
35+ echo " AdNauseam is already up to date. Installed version: $CURRENT_VERSION "
36+ fi
37+ else
38+ echo " AdNauseam extension directory not found. Please make sure it is installed."
39+ fi
0 commit comments