Skip to content

Commit e0f6f40

Browse files
committed
Document ultra portable scripting
1 parent 5299d5b commit e0f6f40

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/scripting.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,19 @@ show it off.
111111

112112
We make use of `pkgx` scripting all over our repositories. Check them out!
113113

114+
## Ultra Portable Scripts
115+
116+
Requiring a `pkgx` shebang is somewhat limiting. Instead you can use our `cURL`
117+
one-liner coupled with `+pkg` syntax to temporarily install pkgs and utilize
118+
them in your scripts:
119+
120+
```sh
121+
#!/bin/bash
122+
123+
eval "$(sh <(curl https://pkgx.sh) +git)"
124+
125+
which git # prints soemthing like /tmp/pkgx/git-scm.org/v2.46.3/bin/git
126+
```
127+
114128
[shebang]: https://en.wikipedia.org/wiki/Shebang_(Unix)
115129
[Scriptisto]: https://github.com/igor-petruk/scriptisto

0 commit comments

Comments
 (0)