Skip to content

Commit 3d1f3c3

Browse files
authored
Merge pull request #2002 from ember-learn/fix-prompt-user-for-EmberData-version-in-minor-release-script
fix: allow EmberData version to be set on release:minor script
2 parents 5a873bb + f2ffa79 commit 3d1f3c3

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

scripts/create-new-minor-version

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ NEXT_VERSION=$MAJOR_VERSION.$(($MINOR_VERSION+1)).$PATCH_VERSION
4848

4949
# Copy the current release guides into the appropriate version-numbered folder.
5050
# `-r` is for recursive, so all directory content is copied.
51+
echo "🤖 Removing any directories for $CURRENT_VERSION"
52+
rm -rf guides/$CURRENT_VERSION
5153
echo "🤖 Copying release to $CURRENT_VERSION"
5254
cp -r guides/release guides/$CURRENT_VERSION
5355
echo " DONE"
@@ -66,9 +68,12 @@ sed -i .bak -e "/currentVersion/i \\
6668
rm guides/versions.yml.bak
6769
echo " DONE"
6870

71+
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."
72+
read -r EMBER_DATA_CURRENT_VERSION
73+
6974
# Update version numbers in links
7075
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
76+
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
7277
echo " DONE"
7378

7479
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)