Skip to content

Commit

Permalink
pkgx is a universal interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Oct 3, 2023
1 parent 890d61f commit 5e3ee96
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/run/anywhere/scripts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# `pkgx` & Scripting

## `pkgx` is a “Universal” Interpreter

```
$ pkgx ./script.py
pkgx: running python ./script.py
$ pkgx ./script.ts
pkgx: running: deno run ./script.ts
$ head -n1 ./script
#!/usr/bin/ruby
$ pkgx ./script
pkgx: running: ruby ./script
```

We read the shebang and install the interpreter before executing the script.
If there is no shebang we use the default interpreter for the file extension.

## shebangs

You can use `pkgx` as the [shebang] for your scripts:
Expand Down

0 comments on commit 5e3ee96

Please sign in to comment.