Skip to content

Commit

Permalink
More resilient readme updates when bumping version (#130)
Browse files Browse the repository at this point in the history
* more resilient readme updates when bumping version

* remove unnecssary escape char
  • Loading branch information
kochis authored Oct 2, 2023
1 parent fc6cb74 commit 23443af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
Add the following script in your `html` file
```html
<script src="https://js.radar.com/v4.1.7/radar.min.js"></script>
<script src="https://js.radar.com/v4.1.11/radar.min.js"></script>
```

Then initialize the Radar SDK
Expand All @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.7/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.7/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.11/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.11/radar.min.js"></script>
</head>

<body>
Expand All @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.7/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.7/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.11/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.11/radar.min.js"></script>
</head>

<body>
Expand Down Expand Up @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.7/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.7/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.11/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.11/radar.min.js"></script>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions scripts/bump-version.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 23443af

Please sign in to comment.