aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/init.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 00:45:33 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 00:45:33 +0900
commitdec86d887629e8478455f7b4a8a22fcb9aa0f6e3 (patch)
treed29aab13dbb3afc51c2755796c906b87fbab2e74 /crates/mozart/src/commands/init.rs
parent530ebc5e425b254f74fa0d5fce77b87f95395f26 (diff)
downloadphp-mozart-dec86d887629e8478455f7b4a8a22fcb9aa0f6e3.tar.gz
php-mozart-dec86d887629e8478455f7b4a8a22fcb9aa0f6e3.tar.zst
php-mozart-dec86d887629e8478455f7b4a8a22fcb9aa0f6e3.zip
fix(browse): use proper URL validation and match Composer's Windows browser launch
Replace simple prefix check in is_valid_url with url::Url::parse() for structural validation (e.g. "https://" with no host now correctly rejected). Update Windows open_browser to use `start "web" explorer` matching Composer's HomeCommand behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/init.rs')
-rw-r--r--crates/mozart/src/commands/init.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/mozart/src/commands/init.rs b/crates/mozart/src/commands/init.rs
index 15729a8..dc32c7c 100644
--- a/crates/mozart/src/commands/init.rs
+++ b/crates/mozart/src/commands/init.rs
@@ -162,11 +162,13 @@ fn build_non_interactive(args: &InitArgs, working_dir: &Path) -> anyhow::Result<
.clone()
.or_else(|| std::env::var("COMPOSER_DEFAULT_LICENSE").ok());
if let Some(ref license) = resolved_license
- && !validation::validate_license(license) && !license.eq_ignore_ascii_case("proprietary") {
- bail!(
- "Invalid license provided: {license}. Only SPDX license identifiers (https://spdx.org/licenses/) or \"proprietary\" are accepted."
- );
- }
+ && !validation::validate_license(license)
+ && !license.eq_ignore_ascii_case("proprietary")
+ {
+ bail!(
+ "Invalid license provided: {license}. Only SPDX license identifiers (https://spdx.org/licenses/) or \"proprietary\" are accepted."
+ );
+ }
composer.license = resolved_license;
if let Some(ref stability) = args.stability {