aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/version
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-24 21:10:48 +0900
committernsfisis <nsfisis@gmail.com>2026-06-24 21:11:03 +0900
commita8f115666344abe3b606a4a65595ca301e7ac08a (patch)
tree9af244392d41542fae74ceab1be0b8fb473bdd46 /crates/shirabe/src/package/version
parent6dcc2125974e350d1844c5ce1bb3562e224f3435 (diff)
downloadphp-shirabe-a8f115666344abe3b606a4a65595ca301e7ac08a.tar.gz
php-shirabe-a8f115666344abe3b606a4a65595ca301e7ac08a.tar.zst
php-shirabe-a8f115666344abe3b606a4a65595ca301e7ac08a.zip
refactor(process): take cwd as Option<&str> instead of IntoExecCwd
Replace the generic cwd parameter backed by the IntoExecCwd trait with a concrete Option<&str> across execute/execute_args/execute_tty/execute_async. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/version')
-rw-r--r--crates/shirabe/src/package/version/version_guesser.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs
index e13eb5d..5745d68 100644
--- a/crates/shirabe/src/package/version/version_guesser.rs
+++ b/crates/shirabe/src/package/version/version_guesser.rs
@@ -193,7 +193,7 @@ impl VersionGuesser {
"-v".to_string(),
],
&mut output,
- Some(path.to_string()),
+ Some(path),
) {
let mut branches: Vec<String> = vec![];
let mut is_feature_branch = false;
@@ -306,7 +306,7 @@ impl VersionGuesser {
if 0 == self.process.borrow_mut().execute_args(
&command,
&mut command_output,
- Some(path.to_string()),
+ Some(path),
) {
let parsed = trim(
&GitUtil::parse_rev_list_output(&command_output, &self.process),
@@ -341,7 +341,7 @@ impl VersionGuesser {
"--tags".to_string(),
],
&mut output,
- Some(path.to_string()),
+ Some(path),
) {
match self.version_parser.normalize(&trim(&output, None), None) {
Ok(version) => return Ok(Some((version, trim(&output, None)))),
@@ -365,7 +365,7 @@ impl VersionGuesser {
if 0 == self.process.borrow_mut().execute_args(
&["hg".to_string(), "branch".to_string()],
&mut output,
- Some(path.to_string()),
+ Some(path),
) {
let branch = trim(&output, None);
let version = self.version_parser.normalize_branch(&branch)?;
@@ -533,9 +533,11 @@ impl VersionGuesser {
},
&scm_cmdline,
);
- let mut process = tokio::runtime::Runtime::new()
- .unwrap()
- .block_on(self.process.borrow_mut().execute_async(&cmd_line, path))?;
+ let mut process = tokio::runtime::Runtime::new().unwrap().block_on(
+ self.process
+ .borrow_mut()
+ .execute_async(&cmd_line, Some(path)),
+ )?;
if !process.is_successful() {
continue;
}
@@ -611,7 +613,7 @@ impl VersionGuesser {
"list".to_string(),
],
&mut output,
- Some(path.to_string()),
+ Some(path),
) {
let branch = trim(&output, None);
version = Some(self.version_parser.normalize_branch(&branch)?);
@@ -623,7 +625,7 @@ impl VersionGuesser {
if 0 == self.process.borrow_mut().execute_args(
&["fossil".to_string(), "tag".to_string(), "list".to_string()],
&mut output,
- Some(path.to_string()),
+ Some(path),
) {
match self.version_parser.normalize(&trim(&output, None), None) {
Ok(v) => {
@@ -658,7 +660,7 @@ impl VersionGuesser {
if 0 == self.process.borrow_mut().execute_args(
&["svn".to_string(), "info".to_string(), "--xml".to_string()],
&mut output,
- Some(path.to_string()),
+ Some(path),
) {
let trunk_path = package_config
.get("trunk-path")