diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-10-10 05:31:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 05:31:23 -0400 |
commit | e7562eed8c816cd0d97aab6b818d7c8453dbaa2b (patch) | |
tree | c5a9f536e79d2c8d2d02897511a9138acaf35394 /std/installer/README.md | |
parent | 3882c9d19a641e0c919f1350d87c6d7ee280cf78 (diff) | |
parent | 93f7f00c956c14620ef031626f124b57397ca867 (diff) |
Merge deno_std in main repo (#3091)
The history of deno_std is persevered but rewritten to update links to issues and PRs
Fixes denoland/deno_std#603
Diffstat (limited to 'std/installer/README.md')
m--------- | std | 0 | ||||
-rw-r--r-- | std/installer/README.md | 89 |
2 files changed, 89 insertions, 0 deletions
diff --git a/std b/std deleted file mode 160000 -Subproject 43aafbf33285753e7b42230f0eb7969b300f71c diff --git a/std/installer/README.md b/std/installer/README.md new file mode 100644 index 000000000..f78c86e91 --- /dev/null +++ b/std/installer/README.md @@ -0,0 +1,89 @@ +# deno_installer + +Install remote or local script as executables. + +## Installation + +`installer` can be installed using itself: + +```sh +deno -A https://deno.land/std/installer/mod.ts deno_installer https://deno.land/std/installer/mod.ts -A +``` + +## Usage + +Install script + +```sh +# 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: + +```sh +$ 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 + +```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 +> +> [1/1] Compiling file:///dev/deno_std/http/file_server.ts +> +> ✅ Successfully installed file_server. +``` + +Show help + +```sh +$ 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) +``` |