Skip to content

Commit 39a23e8

Browse files
committed
fix(scriptlet): adding runtimes
1 parent 2e3ead7 commit 39a23e8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/main/scriptlet.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import untildify from 'untildify'
1010
const toolExtensionMap = new Map([
1111
['ruby', 'rb'],
1212
['python', 'py'],
13+
['python3', 'py'],
1314
['perl', 'pl'],
1415
['php', 'php'],
1516
['node', 'js'],
@@ -26,12 +27,20 @@ const toolExtensionMap = new Map([
2627
['clojure', 'clj'],
2728
['elixir', 'ex'],
2829
['erlang', 'erl'],
29-
['ocaml', 'ml']
30+
['ocaml', 'ml'],
31+
['osascript', 'scpt'],
32+
['deno', 'ts'],
33+
['kotlin', 'kt'],
34+
['julia', 'jl'],
35+
['dart', 'dart'],
36+
['haskell', 'hs'],
37+
['csharp', 'cs']
3038
])
3139

3240
const toolCommandMap = new Map([
3341
['ruby', (scriptPath) => `ruby ${scriptPath}`],
3442
['python', (scriptPath) => `python ${scriptPath}`],
43+
['python3', (scriptPath) => `python3 ${scriptPath}`],
3544
['perl', (scriptPath) => `perl ${scriptPath}`],
3645
['php', (scriptPath) => `php ${scriptPath}`],
3746
['node', (scriptPath) => `node ${scriptPath}`],
@@ -49,7 +58,14 @@ const toolCommandMap = new Map([
4958
['clojure', (scriptPath) => `clojure ${scriptPath}`],
5059
['elixir', (scriptPath) => `elixir ${scriptPath}`],
5160
['erlang', (scriptPath) => `escript ${scriptPath}`],
52-
['ocaml', (scriptPath) => `ocaml ${scriptPath}`]
61+
['ocaml', (scriptPath) => `ocaml ${scriptPath}`],
62+
['osascript', (scriptPath) => `osascript ${scriptPath}`],
63+
['deno', (scriptPath) => `deno run ${scriptPath}`],
64+
['kotlin', (scriptPath) => `kotlinc -script ${scriptPath}`],
65+
['julia', (scriptPath) => `julia ${scriptPath}`],
66+
['dart', (scriptPath) => `dart run ${scriptPath}`],
67+
['haskell', (scriptPath) => `runhaskell ${scriptPath}`],
68+
['csharp', (scriptPath) => `dotnet script ${scriptPath}`]
5369
])
5470

5571
export let runScriptlet = async (focusedScriptlet: Scriptlet, inputs: string[], flag?: Flags) => {

0 commit comments

Comments
 (0)