We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6941744 commit 827a6f2Copy full SHA for 827a6f2
server/scripts/update-release-version.sh
@@ -278,6 +278,17 @@ update_pack_version() {
278
update_ts_version() {
279
local file="$1"
280
local new_version="$2"
281
+ local matches
282
+
283
+ ## Ensure there is exactly one VERSION constant to update
284
+ matches=$(grep -c "const VERSION = '" "${file}" || true)
285
+ if [[ "${matches}" -eq 0 ]]; then
286
+ echo "Error: Could not find a 'const VERSION = ...' definition in ${file}" >&2
287
+ exit 1
288
+ elif [[ "${matches}" -gt 1 ]]; then
289
+ echo "Error: Found multiple 'const VERSION = ...' definitions in ${file}" >&2
290
291
+ fi
292
sed -i.bak "s/const VERSION = '[^']*'/const VERSION = '${new_version}'/" "${file}"
293
rm -f "${file}.bak"
294
}
0 commit comments