Commit a9f0300 1 parent d09b38b commit a9f0300 Copy full SHA for a9f0300
File tree 1 file changed +10
-1
lines changed
src/commands/auth/sfdxurl
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,16 @@ export default class Store extends SfdxCommand {
52
52
public async run ( ) : Promise < AuthFields > {
53
53
if ( await Prompts . shouldExitCommand ( this . ux , this . flags . noprompt ) ) return { } ;
54
54
55
- const sfdxAuthUrl = await fs . readFile ( this . flags . sfdxurlfile , 'utf8' ) ;
55
+ let sfdxAuthUrl ;
56
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
57
+ if ( this . flags . sfdxurlfile . endsWith ( 'json' ) ) {
58
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
59
+ sfdxAuthUrl = await fs . readJson ( this . flags . sfdxurlfile ) ;
60
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
61
+ sfdxAuthUrl = sfdxAuthUrl . sfdxAuthUrl ;
62
+ } else {
63
+ sfdxAuthUrl = await fs . readFile ( this . flags . sfdxurlfile , 'utf8' ) ;
64
+ }
56
65
const oauth2Options = AuthInfo . parseSfdxAuthUrl ( sfdxAuthUrl ) ;
57
66
const authInfo = await AuthInfo . create ( { oauth2Options } ) ;
58
67
await authInfo . save ( ) ;
You can’t perform that action at this time.
0 commit comments