Skip to content

Fix v2 cli flag being incorrectly applied #1270

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

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/bin/tectonic/v2cli/commands/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ impl WatchCommand {
.expect("Executable path wasn't valid UTF-8");
let mut cmds = Vec::new();

let v2cli_default = exe_name.contains("nextonic");

#[cfg(windows)]
let shell = Shell::cmd();
#[cfg(unix)]
Expand All @@ -56,10 +58,16 @@ impl WatchCommand {
for x in self.execute.iter() {
let x = x.trim();
if !x.is_empty() {
let command = if v2cli_default {
format!("\"{exe_name}\" {}", x)
} else {
format!("\"{exe_name}\" -X {}", x)
};

let cmd = Command {
program: Program::Shell {
shell: shell.clone(),
command: format!("\"{exe_name}\" -X {x}"),
command,
args: vec![],
},
options: Default::default(),
Expand All @@ -69,13 +77,21 @@ impl WatchCommand {
}

if cmds.is_empty() {
let mut args = Vec::with_capacity(2);

if !v2cli_default {
args.push("-X".to_string());
}
args.push("build".to_string());

let cmd = Command {
program: Program::Exec {
prog: exe_name.into(),
args: vec!["-X".to_string(), "build".to_string()],
args,
},
options: Default::default(),
};

cmds.push((Id::default(), Arc::new(cmd)));
}

Expand Down