@@ -339,7 +339,6 @@ def get_flask_application(
339
339
file_or_module_name : str ,
340
340
no_frontend : Optional [bool ] = False ,
341
341
lazy : Optional [bool ] = False ,
342
- dir_mode : Optional [bool ] = False ,
343
342
package_mode : Optional [bool ] = False ,
344
343
from_git : Optional [str ] = None ,
345
344
repo_dir : Optional [str ] = None ,
@@ -358,7 +357,6 @@ def get_flask_application(
358
357
file_or_module_name (str): The file or module name to run.
359
358
no_frontend (bool): If you want to disable the frontend, default is False
360
359
lazy (bool): If you want to enable lazy mode, default is False
361
- dir_mode (bool): If you want to enable dir mode, default is False
362
360
package_mode (bool): If you want to enable package mode, default is False
363
361
from_git (str): If you want to run the app from a git repo, default is None
364
362
repo_dir (str): If you want to run the app from a git repo, you can specify the directory, default is None
@@ -384,6 +382,14 @@ def get_flask_application(
384
382
if __host_regex :
385
383
enable_funix_host_checker (__host_regex )
386
384
385
+ dir_mode = exists (file_or_module_name ) and isdir (file_or_module_name )
386
+
387
+ if dir_mode and package_mode :
388
+ print (
389
+ 'Error: Cannot use both directory mode and package mode.\n Please run "funix --help" for more information.'
390
+ )
391
+ sys .exit (1 )
392
+
387
393
import_from_config (
388
394
file_or_module_name = file_or_module_name ,
389
395
lazy = lazy ,
0 commit comments