Skip to content

Commit 39dfc1f

Browse files
committed
fix(share): adding share to scriptkit
1 parent 8361489 commit 39dfc1f

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

src/api/kit.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1270,11 +1270,17 @@ ${lastRunBlock}
12701270
shortcut: `${cmd}+.`,
12711271
description: "Open {{name}}'s markdown in your editor"
12721272
},
1273+
'share-script-to-scriptkit': {
1274+
group: 'Share',
1275+
name: 'Share to ScriptKit.com',
1276+
description: 'Share {{name}} to the community script library',
1277+
shortcut: `${cmd}+s`
1278+
},
12731279
'share-script-as-discussion': {
12741280
group: 'Share',
12751281
name: 'Post to Community Scripts',
12761282
description: 'Share {{name}} on GitHub Discussions',
1277-
shortcut: `${cmd}+s`
1283+
shortcut: `${cmd}+opt+s`
12781284
},
12791285
'share-script-as-link': {
12801286
group: 'Share',

src/cli/index.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export interface CLI {
7070
"search-docs": Promise<typeof import("./search-docs")>
7171
"view-docs": Promise<typeof import("./view-docs")>
7272
"share-copy": Promise<typeof import("./share-copy")>
73+
"share-script-to-scriptkit": Promise<
74+
typeof import("./share-script-to-scriptkit")
75+
>
7376
"share-script-as-discussion": Promise<
7477
typeof import("./share-script-as-discussion")
7578
>

src/cli/share-script-to-scriptkit.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//Menu: Share Script to ScriptKit.com
2+
//Description: Copy script to clipboard and open ScriptKit.com to create a new script
3+
4+
let { filePath } = await selectScript(
5+
`Share which script?`
6+
)
7+
8+
const content = await readFile(filePath, "utf8")
9+
await clipboard.writeText(content)
10+
await notify({
11+
title: "Script contents copied to clipboard",
12+
body: "Opening scriptkit.com/new to paste script"
13+
})
14+
15+
await open(`https://scriptkit.com/new`)
16+
17+
export {}

src/cli/share.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ let how: keyof CLI = await arg(
1515
resize: true,
1616
},
1717
[
18+
{
19+
name: "Share on ScriptKit.com",
20+
description:
21+
"Post script to the community script library",
22+
value: "share-script-to-scriptkit",
23+
},
1824
{
1925
name: "Create Github Discussion",
2026
description:

0 commit comments

Comments
 (0)