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

CLI also shows helpful information, when normally error: No config file found would be thrown. #440

Open
almereyda opened this issue Jun 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@almereyda
Copy link

Enter your suggestions in details:

In trying to wrap my head around using the Lume CLI

I am trying to get help by the CLI about how it can be used, but it always complains, because I'm not in a project directory.

$ [[ $PWD = $HOME ]]; echo $? 
0
$ deno task lume -h
error: No config file found
$ lume -h          
error: No config file found

I should be able to get help, also when I'm not in a project directory.

@almereyda almereyda added the enhancement New feature or request label Jun 30, 2023
@not-my-profile
Copy link
Contributor

This is caused by the init.ts script registering lume as a task in deno.json, as opposed to creating an executable in some directory on your $PATH. E.g. assuming you have $HOME/.local/bin on your $PATH then you could create ~/.local/bin/lume with:

deno run -A https://deno.land/x/lume@v1.18.1/cli.ts "$@"

(and mark it as executable with chmod +x ~/.local/bin/lume) which would let you run lume in any directory.

The disadvantage of this approach is that then:

  • the used lume version is no longer specified in your project directory, which usually is a good idea since it ideally makes your build reproducible
  • the barrier is higher for other contributors (but that might not apply for personal projects) ... if you still have the task in deno.json they might end up using a different lume version than you, if you use your own executable

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

No branches or pull requests

2 participants