Skip to content

Commit 650cccc

Browse files
author
Dimitri Kopriwa
committed
fix(deploy): renaming --version to --target-version
1 parent 5256b04 commit 650cccc

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,4 @@
333333
},
334334
"declinationId": "cli",
335335
"contributors": []
336-
}
336+
}

src/cli/cmds/deploy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ exports.builder = (yargs) => yargs
88
alias: 'y',
99
describe: 'Use yarn instead of npm',
1010
})
11-
.option('version', {
12-
type: 'boolean',
13-
alias: 'v',
14-
describe: 'Version',
11+
.option('target-version', {
12+
type: 'text',
13+
alias: 't',
14+
describe: 'Target version',
1515
});
1616

1717
exports.handler = (args) => {

src/deploy.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ function die() {
1111
# Initialize all the option variables.
1212
# This ensures we are not contaminated by variables from the environment.
1313
installer=npm
14-
version=
14+
targetVersion=
1515

1616
while :; do
1717
case $1 in
1818
-y|--yarn)
1919
installer=yarn
2020
;;
21-
-v|--version) # Takes an option argument; ensure it has been specified.
21+
-t|--target-version) # Takes an option argument; ensure it has been specified.
2222
if [ "$2" ]; then
2323
version=$2
2424
shift
2525
else
26-
die 'ERROR: "--version" requires a non-empty option argument.'
26+
die 'ERROR: "--target-version" requires a non-empty option argument.'
2727
fi
2828
;;
29-
--version=?*)
29+
--target-version=?*)
3030
version=${1#*=} # Delete everything up to "=" and assign the remainder.
3131
;;
32-
--version=) # Handle the case of an empty --version=
33-
die 'ERROR: "--version" requires a non-empty option argument.'
32+
--target-version=) # Handle the case of an empty --target-version=
33+
die 'ERROR: "--target-version" requires a non-empty option argument.'
3434
;;
3535
--) # End of all options.
3636
shift
@@ -47,9 +47,10 @@ while :; do
4747
done
4848

4949

50-
if [[ ! -z ${version} ]]; then
50+
if [[ ! -z ${targetVersion} ]]; then
5151
git fetch --tags
52-
git checkout refs/tags/${version}
52+
git checkout refs/tags/${targetVersion}
53+
echo "[Documentation] target version ${targetVersion}"
5354
fi
5455

5556
if [[ ! -e $PWD/node_modules ]]; then

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const path = require('path');
22
const { spawn } = require('child_process');
33

4-
module.exports = ({ yarn, version }, cb) => {
4+
module.exports = ({ yarn, targetVersion }, cb) => {
55
const args = [];
66
if (yarn) {
77
args.push('--yarn');
88
}
9-
if (version) {
10-
args.push(`--version ${version}`);
9+
if (targetVersion) {
10+
args.push(`--target-version ${targetVersion}`);
1111
}
1212
const ls = spawn('bash', [path.join(__dirname, 'deploy.sh')].concat(args), { stdio: 'inherit' });
1313
ls.on('close', (code) => {

0 commit comments

Comments
 (0)