mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
This commit is contained in:
committed by
GitHub
parent
35f2147161
commit
a1929c6dac
6
.changes/dev-cmd-config-arg.md
Normal file
6
.changes/dev-cmd-config-arg.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"cli.rs": patch
|
||||
"cli.js": patch
|
||||
---
|
||||
|
||||
**Breaking change:** The `dev` command now reads the custom config file from CWD instead of the Tauri folder.
|
||||
@@ -50,7 +50,7 @@ pub fn command(options: Options) -> Result<()> {
|
||||
Some(if config.starts_with('{') {
|
||||
config.to_string()
|
||||
} else {
|
||||
std::fs::read_to_string(&config)?
|
||||
std::fs::read_to_string(&config).with_context(|| "failed to read custom configuration")?
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
||||
@@ -79,16 +79,18 @@ pub fn command(options: Options) -> Result<()> {
|
||||
|
||||
fn command_internal(options: Options) -> Result<()> {
|
||||
let tauri_path = tauri_dir();
|
||||
set_current_dir(&tauri_path).with_context(|| "failed to change current working directory")?;
|
||||
let merge_config = if let Some(config) = &options.config {
|
||||
Some(if config.starts_with('{') {
|
||||
config.to_string()
|
||||
} else {
|
||||
std::fs::read_to_string(&config)?
|
||||
std::fs::read_to_string(&config).with_context(|| "failed to read custom configuration")?
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
set_current_dir(&tauri_path).with_context(|| "failed to change current working directory")?;
|
||||
|
||||
let config = get_config(merge_config.as_deref())?;
|
||||
|
||||
if let Some(before_dev) = &config
|
||||
|
||||
Reference in New Issue
Block a user