2019-06-14 11:43:06 -04:00
|
|
|
# deno_installer
|
|
|
|
|
|
|
|
Install remote or local script as executables.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2019-06-20 10:52:18 -04:00
|
|
|
`installer` can be install using itself:
|
2019-06-14 11:43:06 -04:00
|
|
|
|
|
|
|
```sh
|
|
|
|
deno -A https://deno.land/std/installer/mod.ts deno_installer https://deno.land/std/installer/mod.ts -A
|
2019-06-16 11:45:40 -04:00
|
|
|
```
|
2019-06-14 11:43:06 -04:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Install script
|
|
|
|
|
|
|
|
```sh
|
2019-06-20 10:52:18 -04:00
|
|
|
# remote script
|
2019-06-14 11:43:06 -04:00
|
|
|
$ deno_installer file_server https://deno.land/std/http/file_server.ts --allow-net --allow-read
|
2019-06-20 10:52:18 -04:00
|
|
|
> [1/1] Compiling https://deno.land/std/http/file_server.ts
|
2019-06-14 11:43:06 -04:00
|
|
|
>
|
|
|
|
> ✅ Successfully installed file_server.
|
2019-06-20 10:52:18 -04:00
|
|
|
> ~/.deno/bin/file_server
|
2019-06-14 11:43:06 -04:00
|
|
|
|
|
|
|
# local script
|
|
|
|
$ deno_installer file_server ./deno_std/http/file_server.ts --allow-net --allow-read
|
2019-06-20 10:52:18 -04:00
|
|
|
> [1/1] Compiling file:///dev/deno_std/http/file_server.ts
|
2019-06-14 11:43:06 -04:00
|
|
|
>
|
|
|
|
> ✅ Successfully installed file_server.
|
2019-06-20 10:52:18 -04:00
|
|
|
> ~/.deno/bin/file_server
|
2019-06-14 11:43:06 -04:00
|
|
|
```
|
|
|
|
|
2019-06-20 10:52:18 -04:00
|
|
|
Run installed script:
|
2019-06-14 11:43:06 -04:00
|
|
|
|
|
|
|
```sh
|
|
|
|
$ file_server
|
|
|
|
HTTP server listening on http://0.0.0.0:4500/
|
|
|
|
```
|
|
|
|
|
2019-06-20 10:52:18 -04:00
|
|
|
## Custom installation directory
|
|
|
|
|
|
|
|
By default installer uses `~/.deno/bin` to store installed scripts so make sure it's in your `$PATH`.
|
|
|
|
|
|
|
|
```
|
|
|
|
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc # change this to your shell
|
|
|
|
```
|
|
|
|
|
|
|
|
If you prefer to change installation directory use `-d` or `--dir` flag.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ deno_installer --dir /usr/local/bin file_server ./deno_std/http/file_server.ts --allow-net --allow-read
|
|
|
|
> [1/1] Compiling file:///dev/deno_std/http/file_server.ts
|
|
|
|
>
|
|
|
|
> ✅ Successfully installed file_server.
|
|
|
|
> /usr/local/bin/file_server
|
|
|
|
```
|
|
|
|
|
|
|
|
## Update installed script
|
2019-06-14 11:43:06 -04:00
|
|
|
|
|
|
|
```sh
|
|
|
|
$ deno_installer file_server https://deno.land/std/http/file_server.ts --allow-net --allow-read
|
|
|
|
> ⚠️ file_server is already installed, do you want to overwrite it? [yN]
|
|
|
|
> y
|
|
|
|
>
|
2019-06-20 10:52:18 -04:00
|
|
|
> [1/1] Compiling file:///dev/deno_std/http/file_server.ts
|
2019-06-14 11:43:06 -04:00
|
|
|
>
|
|
|
|
> ✅ Successfully installed file_server.
|
|
|
|
```
|
|
|
|
|
|
|
|
Show help
|
|
|
|
|
|
|
|
```sh
|
|
|
|
$ deno_installer --help
|
|
|
|
> deno installer
|
|
|
|
Install remote or local script as executables.
|
|
|
|
|
|
|
|
USAGE:
|
2019-06-20 10:52:18 -04:00
|
|
|
deno -A https://deno.land/std/installer/mod.ts [OPTIONS] EXE_NAME SCRIPT_URL [FLAGS...]
|
2019-06-14 11:43:06 -04:00
|
|
|
|
|
|
|
ARGS:
|
|
|
|
EXE_NAME Name for executable
|
|
|
|
SCRIPT_URL Local or remote URL of script to install
|
2019-06-20 10:52:18 -04:00
|
|
|
[FLAGS...] List of flags for script, both Deno permission and script specific
|
|
|
|
flag can be used.
|
|
|
|
|
|
|
|
OPTIONS:
|
|
|
|
-d, --dir <PATH> Installation directory path (defaults to ~/.deno/bin)
|
2019-06-14 11:43:06 -04:00
|
|
|
```
|