File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
apps/noir-compiler/src/app/services Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,17 @@ export class NoirPluginClient extends PluginClient {
8181 async findProjectRoot ( filePath : string ) : Promise < string | null > {
8282 const srcIndex = filePath . lastIndexOf ( '/src/' )
8383
84- if ( srcIndex === - 1 ) {
84+ let potentialRoot = null
85+
86+ if ( srcIndex > - 1 ) {
87+ potentialRoot = filePath . substring ( 0 , srcIndex )
88+ } else if ( filePath . startsWith ( 'src/' ) ) {
89+ potentialRoot = ''
90+ } else {
8591 console . error ( `File is not located within a 'src' directory: ${ filePath } ` )
8692 return null
8793 }
8894
89- const potentialRoot = filePath . substring ( 0 , srcIndex )
9095 const tomlPath = potentialRoot ? `${ potentialRoot } /Nargo.toml` : 'Nargo.toml'
9196
9297 // @ts -ignore
You can’t perform that action at this time.
0 commit comments