1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-26 00:59:24 -05:00
denoland-deno/std/installer
Ry Dahl a4dde552de
Revert "feat(flags): script arguments come after '--'" (#3681)
Due to complaints about ergonomics and because it breaks shebang on
linux.

This reverts commit 2d5457df15.

BREAKING CHANGE
2020-01-15 19:21:35 -05:00
..
testdata feat: Deno.args now does not include script (#3628) 2020-01-09 11:37:01 -07:00
mod.ts Revert "feat(flags): script arguments come after '--'" (#3681) 2020-01-15 19:21:35 -05:00
README.md Run deno_std tests in github actions 2019-10-09 17:22:22 -04:00
test.ts Revert "feat(flags): script arguments come after '--'" (#3681) 2020-01-15 19:21:35 -05:00

deno_installer

Install remote or local script as executables.

Installation

installer can be installed using itself:

deno -A https://deno.land/std/installer/mod.ts deno_installer https://deno.land/std/installer/mod.ts -A

Usage

Install script

# remote script
$ deno_installer file_server https://deno.land/std/http/file_server.ts --allow-net --allow-read
> [1/1] Compiling https://deno.land/std/http/file_server.ts
>
> ✅ Successfully installed file_server.
> ~/.deno/bin/file_server

# local script
$ deno_installer 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.
> ~/.deno/bin/file_server

Run installed script:

$ file_server
HTTP server listening on http://0.0.0.0:4500/

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

$ 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
>
> [1/1] Compiling file:///dev/deno_std/http/file_server.ts
>
> ✅ Successfully installed file_server.

Show help

$ deno_installer --help
> deno installer
  Install remote or local script as executables.

USAGE:
  deno -A https://deno.land/std/installer/mod.ts [OPTIONS] EXE_NAME SCRIPT_URL [FLAGS...]

ARGS:
  EXE_NAME  Name for executable
  SCRIPT_URL  Local or remote URL of script to install
  [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)