Skip to content

Commit

Permalink
Merge pull request #5 from Thomasevano/master
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentHardouin authored Nov 11, 2021
2 parents 80a4aaa + 4ffab59 commit dfd669c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ And wait :hourglass: with :coffee:
-h, --help show this help message and exit
-m, --markdown display updated packages in markdown table
-e, --exclude exclude package name seprated by a comma (e.g -e lodash,mocha)
-nt, --no-test does not run test command when update package
```

## Features
Expand Down
11 changes: 10 additions & 1 deletion npm-bump
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ function handle_arguments() {
exclude=$1
transform_exclude_package_names
;;
-nt | --no-test)
no_test=1
;;
*)
break
;;
Expand All @@ -48,6 +51,7 @@ function show_help() {
printf " %-25s %s\n" "-h, --help" "show this help message and exit"
printf " %-25s %s\n" "-m, --markdown" "display updated packages in markdown table"
printf " %-25s %s\n" "-e, --exclude" "exclude package name seprated by a comma (e.g -e lodash,mocha)"
printf " %-25s %s\n" "-nt, --no-test" "does not run test command when update package"
}

function commit_bump() {
Expand Down Expand Up @@ -75,7 +79,12 @@ function bump_version() {
if [ -n "$outdated_packages" ]; then
while read package actual_version coll3 latest_version col5; do
echo "Try to bump ${package} from ${actual_version} to ${latest_version}"
npm install $package@$latest_version && npm test

if [ -z ${no_test} ]; then
npm install $package@$latest_version && npm test
else
npm install $package@$latest_version
fi

if [ $? -eq 0 ]; then
commit_bump $package $actual_version $latest_version
Expand Down

0 comments on commit dfd669c

Please sign in to comment.