File tree 4 files changed +7
-13
lines changed
4 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 7
7
// CLI, we can remove this, and fold the lib/auth/legacy.js back into
8
8
// lib/adduser.js
9
9
10
- const { promisify } = require ( 'util' )
11
-
12
10
const log = require ( 'npmlog' )
13
11
const profile = require ( 'npm-profile' )
14
12
const npmFetch = require ( 'npm-registry-fetch' )
15
13
16
- const openUrl = promisify ( require ( '../utils/open-url.js' ) )
14
+ const openUrl = require ( '../utils/open-url.js' )
17
15
const otplease = require ( '../utils/otplease.js' )
18
16
19
17
const pollForSession = ( { registry, token, opts } ) => {
Original file line number Diff line number Diff line change 1
1
const log = require ( 'npmlog' )
2
2
const pacote = require ( 'pacote' )
3
3
const { URL } = require ( 'url' )
4
- const { promisify } = require ( 'util' )
5
4
6
5
const hostedFromMani = require ( './utils/hosted-git-info-from-manifest.js' )
7
- const openUrl = promisify ( require ( './utils/open-url.js' ) )
6
+ const openUrl = require ( './utils/open-url.js' )
8
7
const usageUtil = require ( './utils/usage.js' )
9
8
10
9
class Repo {
Original file line number Diff line number Diff line change @@ -22,14 +22,12 @@ const sso = requireInject('../../../lib/auth/sso.js', {
22
22
} ,
23
23
'npm-profile' : profile ,
24
24
'npm-registry-fetch' : npmFetch ,
25
- '../../../lib/utils/open-url.js' : ( npm , url , msg , cb ) => {
26
- if ( url )
27
- cb ( )
28
- else {
29
- cb ( Object . assign (
25
+ '../../../lib/utils/open-url.js' : async ( npm , url , msg ) => {
26
+ if ( ! url ) {
27
+ throw Object . assign (
30
28
new Error ( 'failed open url' ) ,
31
29
{ code : 'ERROR' }
32
- ) )
30
+ )
33
31
}
34
32
} ,
35
33
'../../../lib/utils/otplease.js' : ( opts , fn ) => {
Original file line number Diff line number Diff line change @@ -108,10 +108,9 @@ const pacote = {
108
108
109
109
// keep a tally of which urls got opened
110
110
const opened = { }
111
- const openUrl = async ( npm , url , errMsg , cb ) => {
111
+ const openUrl = async ( npm , url , errMsg ) => {
112
112
opened [ url ] = opened [ url ] || 0
113
113
opened [ url ] ++
114
- process . nextTick ( cb )
115
114
}
116
115
117
116
const Repo = requireInject ( '../../lib/repo.js' , {
You can’t perform that action at this time.
0 commit comments