Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search results for config file might be unintuitive #57

Open
naitian opened this issue Feb 13, 2023 · 2 comments
Open

Search results for config file might be unintuitive #57

naitian opened this issue Feb 13, 2023 · 2 comments

Comments

@naitian
Copy link
Member

naitian commented Feb 13, 2023

This is a bug in code that I wrote (oops).

I'm pretty sure if your directory structure looks like this:

- dir/
  - sink.config.json
  - dir2/
    - config.json

and you run sink inside of dir2, it will use sink.config.json instead of config.json.

This is because the config search runs findUp for each potentially config filename, instead of searching for all of the config files at each level of the directory. Pretty sure this can be fixed by just passing in the array of filenames.

@erxclau
Copy link
Member

erxclau commented Feb 14, 2023

Can take a look at this sometime this week. Is that directory structure something you use? Generally curious about how you've been using sink.

@erxclau
Copy link
Member

erxclau commented Mar 19, 2023

Update here: passing an array of filenames didn't work as expected. findUp tries to find the files relative to a directory. By default, it tries to find relative to the current working directory through Node's process.cwd(). However, even when running sink in a subdirectory, it seems that Node considers the root of the project to be the current working directory. And I'm not too sure if there's a built in Node function to find the correct subdirectory that the user executes sink from...

This could be a matter really of how yarn works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants