Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/utils-reference/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ npm install --save @raycast/utils

## Changelog

### v2.2.6

- Fixed `createDeeplink` on Raycast V2

### v2.2.5

- Fixed an issue where `useSql` would not properly show the permission priming screen
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@raycast/utils",
"version": "2.2.5",
"version": "2.2.6",
"description": "Set of utilities to streamline building Raycast extensions",
"author": "Raycast Technologies Ltd.",
"homepage": "https://developers.raycast.com/utilities/getting-started",
Expand Down
12 changes: 2 additions & 10 deletions src/createDeeplink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,13 @@ export type CreateExtensionDeeplinkOptions = CreateInterExtensionDeeplinkOptions
*/
export type CreateDeeplinkOptions = CreateScriptCommandDeeplinkOptions | CreateExtensionDeeplinkOptions;

function getProtocol() {
return environment.raycastVersion.includes("alpha")
? process.env.RAYCASTX
? "raycast-x-internal://"
: "raycastinternal://"
: "raycast://";
}

function getOwnerOrAuthorName() {
const packageJSON = JSON.parse(fs.readFileSync(path.join(environment.assetsPath, "..", "package.json"), "utf8"));
return packageJSON.owner || packageJSON.author;
}

export function createScriptCommandDeeplink(options: CreateScriptCommandDeeplinkOptions): string {
let url = `${getProtocol()}script-commands/${options.command}`;
let url = `${process.env.RAYCAST_SCHEME ?? "raycast"}://script-commands/${options.command}`;

if (options.arguments) {
let params = "";
Expand All @@ -118,7 +110,7 @@ export function createExtensionDeeplink(options: CreateExtensionDeeplinkOptions)
extensionName = options.extensionName;
}

let url = `${getProtocol()}extensions/${ownerOrAuthorName}/${extensionName}/${options.command}`;
let url = `${process.env.RAYCAST_SCHEME ?? "raycast"}://extensions/${ownerOrAuthorName}/${extensionName}/${options.command}`;

let params = "";
if (options.launchType) {
Expand Down
Loading