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 arg to point at Tauri project dir #2844

Closed
OJFord opened this issue Nov 6, 2021 · 3 comments
Closed

CLI arg to point at Tauri project dir #2844

OJFord opened this issue Nov 6, 2021 · 3 comments
Labels

Comments

@OJFord
Copy link
Contributor

OJFord commented Nov 6, 2021

Is your feature request related to a problem? Please describe.
I have a main project dir with a [workspace] Cargo.toml, and a sub-directory which is one of the workspace members, and the Tauri project. I'm usually in the main dir, and can cargo build (all members including the Tauri project) from there, but if I want to cargo tauri dev I get:

thread 'main' panicked at 'Couldn't recognize the current folder as a Tauri project.', /.../tauri-cli-1.0.0-beta.7/src/helpers/app_paths.rs:29:

Describe the solution you'd like

  1. Perhaps ideally, tauri-cli could run against any/all workspace members (iff $PWD is a workspace) that are detected as being tauri projects;
  2. a global CLI argument that allows me to specify where the project is if not $PWD

Describe alternatives you've considered
I was using a package.json script (which included a call to tauri dev) which I could run as yarn --cwd=subdir dev. I decided I wanted to use build.rs and tauri.conf.json's beforeDevCommand as the entrypoints instead, but then found I couldn't do the same.

(Aside, I wouldn't suggest copying 'cwd' - perhaps it's meant to be 'change working directory' (though why not cd then 🤔 ) but I can't help but read it as 'current', which then just seems awkward and doesn't really make sense.)

Additional context

@amrbashir
Copy link
Member

amrbashir commented Nov 6, 2021

possibly duplicate of #2752 and discussion at its PR #2765

@OJFord
Copy link
Contributor Author

OJFord commented Nov 6, 2021

Blimey that was fast. Indeed yes, pretty much, especially with your comment on its PR, sorry I didn't find that.

In my case though tauri --dir=subdir info would still be able to read package.json as normal, because I don't have an 'unusual structure' - I'm just trying to run tauri from a level up from where is.. 'usual' 😉.

i.e. in bash (cd subdir && tauri build/dev/info) would do what I need, a tauri-cli arg would just be more convenient. (Especially since I don't use bash, and this sent me down a rabbit hole opening a fish issue too 😄.)

@amrbashir
Copy link
Member

would love to hear more of your suggestions over at the PR.

@lucasfernog lucasfernog added status: invalid This is not a valid issue and removed status: duplicate labels Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants