diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:10:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:11:03 +0900 |
| commit | c839244d8d09f3036ebfee8eef7eb6b147e593ab (patch) | |
| tree | fe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/command/base_config_command.rs | |
| parent | 48839250146b217e2756ed3c0e624fd341b54d6c (diff) | |
| download | php-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/command/base_config_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/base_config_command.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/base_config_command.rs b/crates/shirabe/src/command/base_config_command.rs index 85bcb68..8b748b4 100644 --- a/crates/shirabe/src/command/base_config_command.rs +++ b/crates/shirabe/src/command/base_config_command.rs @@ -1,6 +1,6 @@ //! ref: composer/src/Composer/Command/BaseConfigCommand.php -use crate::command::base_command::BaseCommand; +use crate::command::base_command::{BaseCommand, BaseCommandData, HasBaseCommandData}; use crate::config::Config; use crate::config::json_config_source::JsonConfigSource; use crate::factory::Factory; @@ -25,13 +25,14 @@ pub trait BaseConfigCommand: BaseCommand { input: &dyn InputInterface, output: &dyn OutputInterface, ) -> anyhow::Result<()> { - self.inner.initialize(input, output)?; + // TODO(phase-b): BaseCommand::initialize chained via Self::initialize would recurse; + // omitted until trait disambiguation is sorted. if input.get_option("global").as_bool() && input.get_option("file").is_not_null() { return Err(anyhow::anyhow!("--file and --global can not be combined")); } - let io = self.inner.get_io(); + let io = self.get_io(); *self.config_mut() = Some(Factory::create_config(io)?); let config = self.config().as_mut().unwrap(); @@ -46,14 +47,14 @@ pub trait BaseConfigCommand: BaseCommand { // Create global composer.json if invoked using `composer global [config-cmd]` if (config_file == "composer.json" || config_file == "./composer.json") && !std::path::Path::new(&config_file).exists() - && std::fs::canonicalize(Platform::get_cwd()).ok() + && std::fs::canonicalize(Platform::get_cwd(false)?).ok() == std::fs::canonicalize(config.get("home").to_string()).ok() { std::fs::write(&config_file, "{\n}\n")?; } let config = self.config().as_ref().unwrap(); - *self.config_file_mut() = Some(JsonFile::new(config_file.clone(), None, Some(io))); + *self.config_file_mut() = Some(JsonFile::new(config_file.clone(), None, Some(io))?); *self.config_source_mut() = Some(JsonConfigSource::new(self.config_file().as_ref().unwrap())); |
