From 23443af73ea80b57ac042963a79b339641fdedca Mon Sep 17 00:00:00 2001 From: Craig Kochis Date: Mon, 2 Oct 2023 16:04:00 -0400 Subject: [PATCH] More resilient readme updates when bumping version (#130) * more resilient readme updates when bumping version * remove unnecssary escape char --- README.md | 14 +++++++------- scripts/bump-version.cjs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 203f6e03..ae91f908 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ }); Add the following script in your `html` file ```html - + ``` Then initialize the Radar SDK @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then ```html - - + + @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis ```html - - + + @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper ```html - - + + diff --git a/scripts/bump-version.cjs b/scripts/bump-version.cjs index e38a65ac..f392d959 100644 --- a/scripts/bump-version.cjs +++ b/scripts/bump-version.cjs @@ -36,8 +36,8 @@ lockfile.version = version; fs.writeFileSync('./package-lock.json', JSON.stringify(lockfile, null, 2) + '\n'); // update versions in readme -const reg = new RegExp(`v${current}`, 'g'); +const reg = new RegExp(`js.radar.com\/v([^/]+)\/`, 'g'); const readme = fs.readFileSync('./README.md').toString(); -fs.writeFileSync('./README.md', readme.replace(reg, `v${version}`)); +fs.writeFileSync('./README.md', readme.replace(reg, `js.radar.com/v${version}/`)); console.log('Updated to', version);