aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/file_downloader.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-19 00:10:22 +0900
committernsfisis <nsfisis@gmail.com>2026-05-19 00:11:03 +0900
commitc839244d8d09f3036ebfee8eef7eb6b147e593ab (patch)
treefe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/downloader/file_downloader.rs
parent48839250146b217e2756ed3c0e624fd341b54d6c (diff)
downloadphp-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst
php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader/file_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/file_downloader.rs37
1 files changed, 19 insertions, 18 deletions
diff --git a/crates/shirabe/src/downloader/file_downloader.rs b/crates/shirabe/src/downloader/file_downloader.rs
index e6b471f..85e43fc 100644
--- a/crates/shirabe/src/downloader/file_downloader.rs
+++ b/crates/shirabe/src/downloader/file_downloader.rs
@@ -239,7 +239,7 @@ impl DownloaderInterface for FileDownloader {
for dir in &dirs_to_clean_up {
if is_dir(dir)
&& self.filesystem.is_dir_empty(dir)?
- && realpath(dir).as_deref() != Some(&Platform::get_cwd())
+ && realpath(dir).as_deref() != Some(&Platform::get_cwd(false).unwrap_or_default())
{
self.filesystem.remove_directory_php(dir)?;
}
@@ -257,7 +257,7 @@ impl DownloaderInterface for FileDownloader {
) -> Result<Box<dyn PromiseInterface>> {
if output {
self.io
- .write_error(&format!(" - {}", InstallOperation::format(package)));
+ .write_error(&format!(" - {}", InstallOperation::format(package, false)));
}
let vendor_dir = self
@@ -277,7 +277,7 @@ impl DownloaderInterface for FileDownloader {
.normalize_path(&format!("{}{}", path, DIRECTORY_SEPARATOR));
strpos(&normalized_vendor, &normalized_path).is_some()
} {
- self.filesystem.empty_directory(path)?;
+ self.filesystem.empty_directory(path, true)?;
}
self.filesystem.ensure_directory_exists(path)?;
self.filesystem.rename(
@@ -294,17 +294,16 @@ impl DownloaderInterface for FileDownloader {
for bin in package.get_binaries() {
let bin_path = format!("{}/{}", path, bin);
if file_exists(&bin_path) && !is_executable(&bin_path) {
- Silencer::call_named(
- "chmod",
- &[
- PhpMixed::String(bin_path),
- PhpMixed::Int((0o777 & !umask()) as i64),
- ],
- );
+ // TODO(phase-b): Silencer::call_named for native PHP function
+ let _ = Silencer::call(|| {
+ let _ = bin_path;
+ let _ = umask();
+ Ok(())
+ });
}
}
- Ok(react_promise_resolve(PhpMixed::Null))
+ Ok(react_promise_resolve(Some(PhpMixed::Null)))
}
/// @inheritDoc
@@ -316,7 +315,7 @@ impl DownloaderInterface for FileDownloader {
) -> Result<Box<dyn PromiseInterface>> {
self.io.write_error(&format!(
" - {}{}",
- UpdateOperation::format(initial, target),
+ UpdateOperation::format(initial, target, false),
self.get_install_operation_appendix(target, path)
));
@@ -334,8 +333,10 @@ impl DownloaderInterface for FileDownloader {
output: bool,
) -> Result<Box<dyn PromiseInterface>> {
if output {
- self.io
- .write_error(&format!(" - {}", UninstallOperation::format(package)));
+ self.io.write_error(&format!(
+ " - {}",
+ UninstallOperation::format(package, false)
+ ));
}
let _promise = self.filesystem.remove_directory_async(path)?;
@@ -394,12 +395,12 @@ impl ChangeReportInterface for FileDownloader {
}
let mut comparer = Comparer::new();
- comparer.set_source(&format!("{}_compare", target_dir));
- comparer.set_update(&target_dir);
+ comparer.set_source(format!("{}_compare", target_dir));
+ comparer.set_update(target_dir.clone());
comparer.do_compare();
- output = comparer.get_changed_as_string(true);
+ output = comparer.get_changed_as_string(true, false);
self.filesystem
- .remove_directory(&format!("{}_compare", target_dir), false)?;
+ .remove_directory(&format!("{}_compare", target_dir))?;
Ok(())
})();
if let Err(err) = result {