Created
February 27, 2018 00:45
-
-
Save danmaq/0af64a0b6f3e795010c444d5f27e9d14 to your computer and use it in GitHub Desktop.
The Expect script for publishing package on npmjs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set NPM_USER [lindex $argv 0] | |
set NPM_EMAIL [lindex $argv 1] | |
set NPM_PASS [lindex $argv 2] | |
set PROMPT "\[#%>\]" | |
spawn yarn publish | |
expect { | |
"New version" { | |
send "\n" | |
exp_continue | |
} | |
"npm username" { | |
send "${NPM_USER}\n" | |
exp_continue | |
} | |
"npm email" { | |
send "${NPM_EMAIL}\n" | |
exp_continue | |
} | |
"npm password" { | |
send "${NPM_PASS}\n" | |
} | |
} | |
expect { | |
-glob "${PROMPT}" { | |
interact | |
exit 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment