Skip to content

Commit ad16b58

Browse files
committed
prompt user to enter EmberData current version and pass it to update links script
- also handle different ember data version when updating links
1 parent 452e29d commit ad16b58

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

scripts/create-new-minor-version

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ sed -i .bak -e "/currentVersion/i \\
6666
rm guides/versions.yml.bak
6767
echo " DONE"
6868

69+
echo "What version of EmberData is being released (e.g. 5.3.0)? Double check this as it might not be the same version as Ember."
70+
read -r EMBER_DATA_CURRENT_VERSION
71+
6972
# Update version numbers in links
7073
echo "🤖 Updating version number for links in /guides/$CURRENT_VERSION/**/*.md"
71-
node scripts/update-version-links guides/$CURRENT_VERSION $(echo $CURRENT_VERSION | cut -d "v" -f2) --silent
74+
node scripts/update-version-links guides/$CURRENT_VERSION $(echo $CURRENT_VERSION | cut -d "v" -f2) $(echo $EMBER_DATA_CURRENT_VERSION | cut -d "v" -f2) --silent
7275
echo " DONE"
7376

7477
echo

scripts/update-version-links

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727

2828
const fs = require('fs');
29-
const replaceURLsVersions = require('./helpers/replace-url-versions')
29+
const replaceURLVersions = require('./helpers/replace-url-versions');
3030
const { Command } = require('commander');
3131
const program = new Command();
3232
program.option('--dry-run')
@@ -39,7 +39,8 @@ program.parse(process.argv);
3939
const options = program.opts();
4040

4141
const currentFolder = fs.realpathSync(program.args[0]);
42-
const newVersionNumber = program.args[1];
42+
const newEmberVersionNumber = program.args[1];
43+
const newEmberDataVersionNumber = program.args[2];
4344

4445
let dryRun = options.dryRun;
4546
let verbose = options.verbose;
@@ -57,7 +58,11 @@ const recursion = (path) => {
5758
recursion(filePath);
5859
} else if (fileName.endsWith('.md')) {
5960
const currentOutput = fs.readFileSync(filePath).toString();
60-
const newOutput = replaceURLsVersions(currentOutput, newVersionNumber);
61+
const newOutput = replaceURLVersions(
62+
currentOutput,
63+
newEmberVersionNumber,
64+
newEmberDataVersionNumber
65+
);
6166

6267
if (currentOutput !== newOutput) {
6368
if (!dryRun) {

0 commit comments

Comments
 (0)