File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,15 +115,22 @@ export class RunAction extends CommandLineAction {
115115 // at the project root
116116 const packageFolder : string | undefined = lookup . tryGetPackageFolderFor ( '.' ) ;
117117
118- if ( packageFolder ) {
119- configFilename = path . join ( packageFolder , AE_CONFIG_FILENAME ) ;
118+ // If there is no package, then try the current directory
119+ const baseFolder : string = packageFolder ? packageFolder : process . cwd ( ) ;
120+
121+ // First try the standard "config" subfolder:
122+ configFilename = path . join ( baseFolder , 'config' , AE_CONFIG_FILENAME ) ;
123+ if ( FileSystem . exists ( configFilename ) ) {
124+ if ( FileSystem . exists ( path . join ( baseFolder , AE_CONFIG_FILENAME ) ) ) {
125+ throw new Error ( `Found conflicting ${ AE_CONFIG_FILENAME } files in "." and "./config" folders` ) ;
126+ }
120127 } else {
121- // If there is no package, then try the current directory
122- configFilename = path . join ( process . cwd ( ) , AE_CONFIG_FILENAME ) ;
123- }
128+ // Otherwise try the top-level folder
129+ configFilename = path . join ( baseFolder , AE_CONFIG_FILENAME ) ;
124130
125- if ( ! FileSystem . exists ( configFilename ) ) {
126- throw new Error ( `Unable to find an ${ AE_CONFIG_FILENAME } file` ) ;
131+ if ( ! FileSystem . exists ( configFilename ) ) {
132+ throw new Error ( `Unable to find an ${ AE_CONFIG_FILENAME } file` ) ;
133+ }
127134 }
128135
129136 console . log ( `Using configuration from ${ configFilename } ` + os . EOL + os . EOL ) ;
You can’t perform that action at this time.
0 commit comments