Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Commit ba08177

Browse files
committed
Grab script from rug
1 parent b0e5af7 commit ba08177

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

npm-publish.bash

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,19 @@ function err() {
1313
msg "$*" 1>&2
1414
}
1515

16-
function publish() {
16+
function main() {
1717
local module_version=$1
18-
local mmodule_name=$2
1918
if [[ ! $module_version ]]; then
2019
err "first parameter must be the version number of the module to publish"
2120
return 10
2221
fi
2322

24-
if [[ ! $module_name ]]; then
25-
err "second parameter must be the name of the module to publish"
26-
return 10
27-
fi
28-
29-
local target="target/.atomist/node_modules/@atomist/${module_name}}"
30-
local package="$target/package.json"
23+
local package="package.json"
3124
local tmp_package="$package.tmp"
3225
if ! jq --arg tag "$TRAVIS_TAG" '.version = "$tag"' "$package" > "$tmp_package"; then
3326
err "failed to set version in $package"
3427
return 1
3528
fi
36-
37-
cp "$tmp_package" "$package"
38-
3929
if [[ $NPM_TOKEN ]]; then
4030
msg "Creating local .npmrc using API key from environment"
4131
if ! ( umask 077 && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > "$HOME/.npmrc" ); then
@@ -56,5 +46,5 @@ function publish() {
5646
fi
5747
}
5848

59-
publish "$@" || exit 1
49+
main "$@" || exit 1
6050
exit 0

0 commit comments

Comments
 (0)