Skip to content

Commit 5db0f18

Browse files
authored
fix: launch uri respect app prefixes (#319)
Launch URIs that include the app's prefix should be respected and opened without expansion. For instance, a URI like `obsidian://open?vault=docs` should work
1 parent 1a922cc commit 5db0f18

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/runner/launch/launch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (r *launchRunner) Exec(
7070

7171
launchSpec.URI = os.ExpandEnv(launchSpec.URI)
7272
targetURI := launchSpec.URI
73-
if !strings.HasPrefix(targetURI, "http") {
73+
if !strings.Contains(targetURI, "://") {
7474
targetURI = utils.ExpandDirectory(
7575
launchSpec.URI,
7676
e.WorkspacePath(),

internal/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func ExpandPath(path, fallbackDir string, env map[string]string) string {
4242
} else {
4343
targetPath = filepath.Join(homeDir, path[2:])
4444
}
45-
case strings.HasPrefix(path, "/"), strings.HasPrefix(path, "$"):
45+
case strings.HasPrefix(path, "/"), strings.HasPrefix(path, "$"), strings.Contains(path, "://"):
4646
targetPath = path
4747
default:
4848
targetPath = filepath.Join(fallbackDir, path)

0 commit comments

Comments
 (0)