File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export default async function exportCMD(params: ExportParams) {
4545 overrides . AUTH0_EXPORT_IDENTIFIERS = exportIds ;
4646 }
4747
48- // Overrides AUTH0_INCLUDE_EXPERIMENTAL_EA is experimental_ea passed in command line
48+ // Overrides AUTH0_EXPERIMENTAL_EA if experimental_ea is passed in command line
4949 if ( experimentalEA ) {
5050 overrides . AUTH0_EXPERIMENTAL_EA = experimentalEA ;
5151
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ export default async function importCMD(params: ImportParams) {
3737 throw new Error ( '--apply must be used with --dry-run.' ) ;
3838 }
3939
40+ if ( interactive && ! effectiveDryRun ) {
41+ throw new Error ( '--interactive must be used with --dry-run.' ) ;
42+ }
43+
44+ if ( interactive && apply ) {
45+ throw new Error ( '--interactive and --apply cannot be used together.' ) ;
46+ }
47+
4048 if ( shouldInheritEnv ) {
4149 nconf . env ( ) . use ( 'memory' ) ;
4250
@@ -61,7 +69,7 @@ export default async function importCMD(params: ImportParams) {
6169 overrides . AUTH0_CLIENT_SECRET = clientSecret ;
6270 }
6371
64- // Overrides AUTH0_INCLUDE_EXPERIMENTAL_EA is experimental_ea passed in command line
72+ // Overrides AUTH0_EXPERIMENTAL_EA if experimental_ea is passed in command line
6573 if ( experimentalEA ) {
6674 overrides . AUTH0_EXPERIMENTAL_EA = experimentalEA ;
6775
Original file line number Diff line number Diff line change @@ -87,6 +87,38 @@ describe('#import command dry-run behavior', () => {
8787 }
8888 } ) ;
8989
90+ it ( 'should require --dry-run when interactive is enabled' , async ( ) => {
91+ try {
92+ await importCMD ( {
93+ _ : [ 'import' ] ,
94+ input_file : 'tenant.yaml' ,
95+ interactive : true ,
96+ env : false ,
97+ } as any ) ;
98+ expect . fail ( 'Expected importCMD to reject when --interactive is used without --dry-run.' ) ;
99+ } catch ( error ) {
100+ expect ( ( error as Error ) . message ) . to . equal ( '--interactive must be used with --dry-run.' ) ;
101+ }
102+ } ) ;
103+
104+ it ( 'should reject when --interactive and --apply are used together' , async ( ) => {
105+ try {
106+ await importCMD ( {
107+ _ : [ 'import' ] ,
108+ input_file : 'tenant.yaml' ,
109+ dry_run : true ,
110+ interactive : true ,
111+ apply : true ,
112+ env : false ,
113+ } as any ) ;
114+ expect . fail ( 'Expected importCMD to reject when --interactive and --apply are both set.' ) ;
115+ } catch ( error ) {
116+ expect ( ( error as Error ) . message ) . to . equal (
117+ '--interactive and --apply cannot be used together.'
118+ ) ;
119+ }
120+ } ) ;
121+
90122 it ( 'should set AUTH0_DRY_RUN_APPLY when apply is enabled' , async ( ) => {
91123 await importCMD ( {
92124 _ : [ 'import' ] ,
You can’t perform that action at this time.
0 commit comments