Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Apr 5, 2024
1 parent 3a126d2 commit ea9da25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/npm/handle-npm-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const handleNpmError = (error, task, message, executor) => {

// `one-time pass` is for npm and `Two factor authentication` is for Yarn.
if (
error.stderr.includes('one-time pass') // npm
error.stderr.includes('one-time pass') // Npm
|| error.stdout.includes('Two factor authentication') // Yarn v1
|| error.stdout.includes('One-time password:') // Yarn berry
) {
Expand Down
8 changes: 5 additions & 3 deletions source/npm/publish.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {execa} from 'execa';

export const getPackagePublishArguments = options => {
const arguments_ = ['publish'];

Expand All @@ -20,15 +22,15 @@ export const getPackagePublishArguments = options => {
return arguments_;
};

export function runPublish(args) {
const cp = execa(...args);
export function runPublish(arguments_) {
const cp = execa(...arguments_);

cp.stdout.on('data', chunk => {
// https://github.com/yarnpkg/berry/blob/a3e5695186f2aec3a68810acafc6c9b1e45191da/packages/plugin-npm/sources/npmHttpUtils.ts#L541
if (chunk.toString('utf8').includes('One-time password:')) {
cp.kill();
}
})
});

return cp;
}

0 comments on commit ea9da25

Please sign in to comment.