@@ -16,6 +16,7 @@ import { ResourceDiscovery } from "../resourceDiscovery.js";
1616import { GitIgnore } from "../gitignore.js" ;
1717import { VsCode } from "../vsCode.js" ;
1818import { Logger } from "../logger.js" ;
19+ import { Configuration } from "../configuration.js" ;
1920
2021const configFileName = path . resolve ( configFileDefaultName ) ;
2122
@@ -205,6 +206,10 @@ export async function getConfigFromWizard({
205206 ] ) ;
206207
207208 if ( answersFilter . function === "Pick one" ) {
209+ // I need to use congiration settings I accquired so far to get the list of lambdas
210+ const configTemp = getConfigFromAnswers ( answers ) ;
211+ Configuration . setConfig ( configTemp as any ) ; // not complete config
212+
208213 lambdasList = await ResourceDiscovery . getLambdas (
209214 getConfigFromAnswers ( answers ) as LldConfig
210215 ) ;
@@ -295,10 +300,17 @@ export async function getConfigFromWizard({
295300 const config = getConfigFromAnswers ( answers ) ;
296301
297302 if ( save ) {
298- // save to file that looks like this:
299- Logger . log ( `Saving to config file ${ configFileName } ` ) ;
303+ await saveConfiguration ( config ) ;
304+ }
305+
306+ return config ;
307+ }
300308
301- const configContent = `
309+ async function saveConfiguration ( config : LldConfigCliArgs ) {
310+ Logger . log ( `Saving to config file ${ configFileName } ` ) ;
311+
312+ // save to file that looks like this:
313+ const configContent = `
302314import { type LldConfigTs } from "lambda-live-debugger";
303315
304316export default {
@@ -321,17 +333,14 @@ export default {
321333} satisfies LldConfigTs;
322334 ` ;
323335
324- // remove lines that contains undefined or ""
325- const configContentCleaned = configContent
326- . trim ( )
327- . split ( "\n" )
328- . filter ( ( l ) => ! l . includes ( "undefined" ) && ! l . includes ( '""' ) )
329- . join ( "\n" ) ;
330-
331- await fs . writeFile ( configFileName , configContentCleaned ) ;
332- }
336+ // remove lines that contains undefined or ""
337+ const configContentCleaned = configContent
338+ . trim ( )
339+ . split ( "\n" )
340+ . filter ( ( l ) => ! l . includes ( "undefined" ) && ! l . includes ( '""' ) )
341+ . join ( "\n" ) ;
333342
334- return config ;
343+ await fs . writeFile ( configFileName , configContentCleaned ) ;
335344}
336345
337346function getConfigFromAnswers ( answers : any ) : LldConfigCliArgs {
0 commit comments