You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a simple script to automatically publish my package to NPM when the version has been bumped.
#!/usr/bin/env node
const{ version, name }=require('../package');const{ exec }=require('child_process');letnpmInfo=exec(`yarn info --json ${name}`,(error,stdout)=>{letnpmVersion=JSON.parse(stdout)["data"]["version"];if(version===npmVersion){process.stdout.write("No version change\n");process.exit(0);}process.stdout.write(`Publishing ${name} to NPM\n`);exec(`yarn publish --new-version ${version}`,(error,stdout)=>{if(error){process.stdout.write(`There was an error publishing ${name} to NPM`);process.exit(1);}process.stdout.write(`Published ${name} to NPM`);});});
This fails because the yarn publish command prompts me for a login. Since this script will be run in CircleCI, I need a way to log in programmatically.
What is the expected behavior?
I found the yarn login command, but it seems like it doesn't have a non-interactive mode. Am I missing something? If not, it would be great if you guys could add this.
Please mention your node.js, yarn and operating system version.
Node: 7.8.0
Yarn: 0.24.6
OS: macOS 10.12.5
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Request a feature
What is the current behavior?
I'm writing a simple script to automatically publish my package to NPM when the version has been bumped.
This fails because the
yarn publish
command prompts me for a login. Since this script will be run in CircleCI, I need a way to log in programmatically.What is the expected behavior?
I found the
yarn login
command, but it seems like it doesn't have anon-interactive
mode. Am I missing something? If not, it would be great if you guys could add this.Please mention your node.js, yarn and operating system version.
Node: 7.8.0
Yarn: 0.24.6
OS: macOS 10.12.5
The text was updated successfully, but these errors were encountered: