@@ -8,6 +8,9 @@ DEPS_DIR="$BASE_DIR/deps"
88[ -z " $NODE " ] && NODE=" $BASE_DIR /out/Release/node"
99[ -x " $NODE " ] || NODE=$( command -v node)
1010
11+ # shellcheck disable=SC1091
12+ . " $BASE_DIR /tools/dep_updaters/utils.sh"
13+
1114NEW_VERSION=" $( " $NODE " --input-type=module << 'EOF '
1215const res = await fetch('https://api.github.com/repos/aklomp/base64/releases/latest');
1316if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res });
1821
1922CURRENT_VERSION=$( grep " base64 LANGUAGES C VERSION" ./deps/base64/base64/CMakeLists.txt | sed -n " s/^.*VERSION \(.*\))/\1/p" )
2023
21- echo " Comparing $NEW_VERSION with $CURRENT_VERSION "
22-
23- if [ " $NEW_VERSION " = " $CURRENT_VERSION " ]; then
24- echo " Skipped because base64 is on the latest version."
25- exit 0
26- fi
24+ # This function exit with 0 if new version and current version are the same
25+ compare_dependency_version " base64" " $NEW_VERSION " " $CURRENT_VERSION "
2726
2827echo " Making temporary workspace"
2928
@@ -51,20 +50,6 @@ mv "$WORKSPACE/base64" "$DEPS_DIR/base64/"
5150# to work, we create it and leave it empty.
5251echo " // Intentionally empty" >> " $DEPS_DIR /base64/base64/lib/config.h"
5352
54- # Update the version number
55- # shellcheck disable=SC1091
56- . " $BASE_DIR /tools/dep_updaters/utils.sh"
57- update_dependency_version " base64" " $NEW_VERSION "
58-
59- echo " All done!"
60- echo " "
61- echo " Please git add base64/base64, commit the new version:"
62- echo " "
63- echo " $ git add -A deps/base64/base64"
64- echo " $ git add doc/contributing/maintaining/maintaining-dependencies.md"
65- echo " $ git commit -m \" deps: update base64 to $NEW_VERSION \" "
66- echo " "
67-
6853# update the base64_version.h
6954cat > " $BASE_DIR /src/base64_version.h" << EOL
7055// This is an auto generated file, please do not edit.
@@ -75,6 +60,8 @@ cat > "$BASE_DIR/src/base64_version.h" << EOL
7560#endif // SRC_BASE64_VERSION_H_
7661EOL
7762
78- # The last line of the script should always print the new version,
79- # as we need to add it to $GITHUB_ENV variable.
80- echo " NEW_VERSION=$NEW_VERSION "
63+ # Update the version number
64+ update_dependency_version " base64" " $NEW_VERSION "
65+
66+ # Echo to commit the new version
67+ finalize_version_update " base64" " $NEW_VERSION "
0 commit comments