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

install doesn't auto discover config file #17572

Closed
vwkd opened this issue Jan 28, 2023 · 3 comments
Closed

install doesn't auto discover config file #17572

vwkd opened this issue Jan 28, 2023 · 3 comments
Labels
invalid what appeared to be an issue with Deno wasn't

Comments

@vwkd
Copy link
Contributor

vwkd commented Jan 28, 2023

It seems deno install currently doesn't auto-discover a deno.json or deno.jsonc config file.

This is suggested in the help entry for deno install -help.

    -c, --config <FILE>
            The configuration file can be used to configure different aspects of
            deno including TypeScript, linting, and code formatting. **Typically
            the configuration file will be called `deno.json` or `deno.jsonc`
            and automatically detected; in that case this flag is not necessary.**
            See
            https://deno.land/[email protected]/getting_started/configuration_file

Steps To Reproduce

deno install -n my-module main.ts

Expected Result

#!/bin/sh
# generated by deno install
exec deno run --config /Users/foo/.deno/bin/.my-module.deno.json 'file:///Users/foo/my-module/main.ts' "$@"

Actual Result

#!/bin/sh
# generated by deno install
exec deno run --no-config 'file:///Users/foo/my-module/main.ts' "$@"
@dsherret
Copy link
Member

This is by design. When running deno install, it's very rare that someone would want it to pull in the config file from the local directory since deno install is a global action rather than a project based one. That said, perhaps it should do this if someone specifies a local file, but I'm not sure that's worth the effort to have different behaviour for considering most people won't be doing that and different behaviour depending on the file specified might create some confusion.

I believe the word "Typically" in the help text means "not always". That help text is shared across many sub commands.

@dsherret dsherret added the invalid what appeared to be an issue with Deno wasn't label Jan 28, 2023
@vwkd
Copy link
Contributor Author

vwkd commented Jan 29, 2023

@dsherret Thanks for the clarification.

Maybe the help entry could mention which commands don't support config file auto-discovery?

Currently deno install --help suggest config file auto-discovery

-c, --config
The configuration file can be used to configure different aspects of
deno including TypeScript, linting, and code formatting. Typically
the configuration file will be called deno.json or deno.jsonc
and automatically detected; in that case this flag is not necessary.

See
https://deno.land/[email protected]/getting_started/configuration_file

@dsherret
Copy link
Member

Opened #17855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid what appeared to be an issue with Deno wasn't
Projects
None yet
Development

No branches or pull requests

2 participants