Warp to Galaxy internal rebrand
This commit is contained in:
@@ -3,7 +3,6 @@ use std::path::Path;
|
||||
|
||||
use command::r#async::Command;
|
||||
use galaxy_core::channel::ChannelState;
|
||||
use galaxy_core::AppId;
|
||||
use galaxyui::ApplicationBundleInfo;
|
||||
use instant::Instant;
|
||||
use objc2::rc::{autoreleasepool, Retained};
|
||||
@@ -347,7 +346,7 @@ pub fn open_file_path_with_line_and_col(
|
||||
if let Some(bundle_id) = bundle_id.as_deref() {
|
||||
let current = ChannelState::app_id().to_string();
|
||||
if bundle_id != current
|
||||
&& is_warp_bundle(bundle_id)
|
||||
&& is_galaxy_bundle(bundle_id)
|
||||
&& open_with_bundle(¤t, full_path)
|
||||
{
|
||||
return;
|
||||
@@ -357,10 +356,8 @@ pub fn open_file_path_with_line_and_col(
|
||||
ctx.open_file_path(full_path);
|
||||
}
|
||||
|
||||
fn is_warp_bundle(bundle_id: &str) -> bool {
|
||||
AppId::parse(bundle_id)
|
||||
.map(|id| id.qualifier() == "dev" && id.organization() == "warp")
|
||||
.unwrap_or(false)
|
||||
fn is_galaxy_bundle(bundle_id: &str) -> bool {
|
||||
bundle_id == "com.galaxy.GalaxyOss"
|
||||
}
|
||||
|
||||
fn open_with_bundle(bundle_id: &str, path: &Path) -> bool {
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
use super::is_warp_bundle;
|
||||
use super::is_galaxy_bundle;
|
||||
|
||||
#[test]
|
||||
fn is_warp_bundle_recognises_warp_channels() {
|
||||
assert!(is_warp_bundle("dev.warp.Warp"));
|
||||
assert!(is_warp_bundle("dev.warp.WarpDev"));
|
||||
assert!(is_warp_bundle("dev.warp.WarpPreview"));
|
||||
assert!(is_warp_bundle("dev.warp.WarpOss"));
|
||||
fn is_galaxy_bundle_recognises_oss() {
|
||||
assert!(is_galaxy_bundle("com.galaxy.GalaxyOss"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn is_warp_bundle_rejects_other_apps() {
|
||||
assert!(!is_warp_bundle("com.microsoft.VSCode"));
|
||||
assert!(!is_warp_bundle("com.apple.TextEdit"));
|
||||
assert!(!is_warp_bundle("dev.zed.Zed"));
|
||||
assert!(!is_warp_bundle("invalid"));
|
||||
assert!(!is_warp_bundle(""));
|
||||
fn is_galaxy_bundle_rejects_other_apps() {
|
||||
assert!(!is_galaxy_bundle("com.microsoft.VSCode"));
|
||||
assert!(!is_galaxy_bundle("com.apple.TextEdit"));
|
||||
assert!(!is_galaxy_bundle("dev.warp.WarpOss"));
|
||||
assert!(!is_galaxy_bundle("invalid"));
|
||||
assert!(!is_galaxy_bundle(""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user