-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(cli.js): allow configuring tauri app path on package.json #2752 #3035
Conversation
`package.json > tauri > appPath` defines the path to the tauri crate and cli.js sets the proper CWD when running cli.rs
if we are gonna add this, then we should probably add the other way around too. |
I think the Rust CLI won't even know about Node.js or the frontend application. Currently it only needs this information for |
yeah you're right, this makes more sense. We also had some reports about some people not able to use the rust cli with a cargo workspace but that's for another PR I guess. |
Can you link that issue? Last time I checked it worked fine, maybe it's some special setup. |
don't remember exactly, maybe it was this #2765 (comment) . |
tooling/cli.js/bin/tauri.js
Outdated
@@ -74,10 +75,21 @@ ${chalk.yellow('Options')} | |||
if (process.argv && process.env.NODE_ENV !== 'test') { | |||
process.argv.splice(0, 3) | |||
} | |||
let cwd = null | |||
if (existsSync('package.json')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could enhance this a bit using https://github.com/sindresorhus/pkg-up , I know I sometimes run npm clis in a nested directory. this would be a cool addition IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, gonna do it tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg-up is literally just calling findUp('package.json', {cwd})
from https://github.com/sindresorhus/find-up, so I'd say use find-up
directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
package.json > tauri > appPath
defines the path to the tauri crate and cli.js sets the proper CWD when running cli.rsWhat kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: