Skip to content

Commit 8d0086c

Browse files
committed
feat: add shell --skip-autodetect
1 parent 0de659d commit 8d0086c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/command/shell.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pub struct Shell {
3232
/// custom shell type
3333
#[arg(short, long)]
3434
shell: Option<ShellType>,
35+
/// skip autodetect go.work/go.mod.
36+
#[arg(short, long)]
37+
skip_autodetect: bool,
3538
#[command(flatten)]
3639
install_options: InstallOptions,
3740
}
@@ -136,7 +139,9 @@ impl Shell {
136139
}
137140
return Ok(version.to_owned());
138141
}
139-
if let Some(ver) = self.get_mod_file_version(local_versions) {
142+
if !self.skip_autodetect
143+
&& let Some(ver) = self.get_mod_file_version(local_versions)
144+
{
140145
// 自动从 go.work/go.mod 文件中获取到版本号
141146
return Ok(ver);
142147
}

0 commit comments

Comments
 (0)