diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 06:19:30 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 06:19:30 +0900 |
| commit | 880a5eaad9dcdfd31563385f11ba1f63d38cfd14 (patch) | |
| tree | 6f9de7b2b8331628a74287112711f65ae3eddc52 /crates/shirabe/src/command/create_project_command.rs | |
| parent | f3d60c7836da0d50d59a22cfd6e4692e3dc75581 (diff) | |
| download | php-shirabe-880a5eaad9dcdfd31563385f11ba1f63d38cfd14.tar.gz php-shirabe-880a5eaad9dcdfd31563385f11ba1f63d38cfd14.tar.zst php-shirabe-880a5eaad9dcdfd31563385f11ba1f63d38cfd14.zip | |
refactor(php-shim): use std::path::MAIN_SEPARATOR over a shim constant
The shim's DIRECTORY_SEPARATOR was hardcoded to "/", so every ported
`'\\' === DIRECTORY_SEPARATOR` check compared against a constant that
does not track the target platform. std::path::MAIN_SEPARATOR and
MAIN_SEPARATOR_STR carry the same meaning as PHP's constant and resolve
per platform, so the Windows branches are selected on Windows targets.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/create_project_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/create_project_command.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index 267c866e..3849d93d 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -44,9 +44,9 @@ use shirabe_external_packages::symfony::console::output::OutputInterface; use shirabe_external_packages::symfony::finder::Finder; use shirabe_php_shim::Catch as _; use shirabe_php_shim::{ - DIRECTORY_SEPARATOR, InvalidArgumentException, PhpMixed, RuntimeException, - UnexpectedValueException, array_pop, chdir, explode_with_limit, file_exists, getcwd, - impl_php_class, implode, is_dir, is_file, mkdir, realpath, rtrim, strtolower, unlink, + InvalidArgumentException, PhpMixed, RuntimeException, UnexpectedValueException, array_pop, + chdir, explode_with_limit, file_exists, getcwd, impl_php_class, implode, is_dir, is_file, + mkdir, realpath, rtrim, strtolower, unlink, }; use std::path::PathBuf; @@ -461,7 +461,7 @@ impl CreateProjectCommand { format!( "{}{}{}", Platform::get_cwd(false)?, - DIRECTORY_SEPARATOR, + std::path::MAIN_SEPARATOR, array_pop(&mut parts).unwrap_or_default() ) } @@ -477,7 +477,7 @@ impl CreateProjectCommand { directory = format!( "{}{}{}", Platform::get_cwd(false)?, - DIRECTORY_SEPARATOR, + std::path::MAIN_SEPARATOR, directory ); } |
