Skip to content

Commit 6349032

Browse files
committed
Check login status before publishing steps are performed
1 parent a8bebe0 commit 6349032

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/preversion.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/bin/bash
22

3+
function is_logged_in(){
4+
( npm whoami ) >/dev/null 2>&1
5+
}
6+
7+
if ! is_logged_in; then
8+
echo "You are not logged into NPM. Publishing will fail, so not continuing. Try \`npm adduser\`"
9+
exit 1
10+
fi
11+
312
for package in $(npm outdated --parseable @sinonjs/fake-timers @sinonjs/samsam)
413
do
514
wanted="$(cut -d: -f2 <<< "$package")"

0 commit comments

Comments
 (0)