@@ -332,10 +332,23 @@ def _configure_app(toolkit: RichToolkit, path_to_deploy: Path) -> AppConfig:
332332
333333 toolkit .print_line ()
334334
335+ directory_input = toolkit .input (
336+ title = "Path to the directory containing your app" ,
337+ tag = "dir" ,
338+ default = "" ,
339+ placeholder = "[italic]Leave empty if it's the current directory[/italic]" ,
340+ )
341+
342+ directory : Optional [str ] = directory_input if directory_input else None
343+
344+ toolkit .print_line ()
345+
335346 toolkit .print ("Deployment configuration:" , tag = "summary" )
336347 toolkit .print_line ()
337348 toolkit .print (f"Team: [bold]{ team .name } [/bold]" )
338349 toolkit .print (f"App name: [bold]{ app_name } [/bold]" )
350+ if directory :
351+ toolkit .print (f"Directory: [bold]{ directory } [/bold]" )
339352 toolkit .print_line ()
340353
341354 choice = toolkit .ask (
@@ -361,7 +374,7 @@ def _configure_app(toolkit: RichToolkit, path_to_deploy: Path) -> AppConfig:
361374
362375 progress .log (f"App created successfully! App slug: { app .slug } " )
363376
364- app_config = AppConfig (app_id = app .id , team_id = team .id )
377+ app_config = AppConfig (app_id = app .id , team_id = team .id , directory = directory )
365378
366379 write_app_config (path_to_deploy , app_config )
367380
@@ -674,7 +687,12 @@ def deploy(
674687 with tempfile .TemporaryDirectory () as temp_dir :
675688 logger .debug ("Creating archive for deployment" )
676689 archive_path = Path (temp_dir ) / "archive.tar"
677- archive (path or Path .cwd (), archive_path )
690+
691+ deploy_path = path or Path .cwd ()
692+ if app_config and app_config .directory :
693+ deploy_path = deploy_path / app_config .directory
694+
695+ archive (deploy_path , archive_path )
678696
679697 with (
680698 toolkit .progress (title = "Creating deployment" ) as progress ,
0 commit comments