From 399d5e3d101df95bf35d71e2ab9542bff004fe3f Mon Sep 17 00:00:00 2001 From: Umberto Pepato Date: Fri, 22 May 2020 17:08:50 +0200 Subject: [PATCH] feat(export): add script exporting functionality --- .github/workflows/test.yml | 6 +- README.md | 148 ++++++++++++++++++++++++++++-------- assets/logo.svg | 1 + deps.ts | 23 +++--- src/build_command_string.ts | 114 +++++++++++++++++++++++++++ src/check_config_data.ts | 17 +++++ src/check_script.ts | 20 +++++ src/cli/commands/export.ts | 26 +++++++ src/cli/commands/vr.ts | 8 +- src/command.ts | 4 +- src/did_you_mean.ts | 10 +-- src/export_scripts.ts | 105 +++++++++++++++++++++++++ src/load_config.ts | 14 ++-- src/logger.ts | 3 +- src/run_commands.ts | 130 +++---------------------------- src/run_script.ts | 29 ++----- src/scripts_config.ts | 14 +--- src/util.ts | 13 ++++ 18 files changed, 467 insertions(+), 218 deletions(-) create mode 100644 assets/logo.svg create mode 100644 src/build_command_string.ts create mode 100644 src/check_config_data.ts create mode 100644 src/check_script.ts create mode 100644 src/cli/commands/export.ts create mode 100644 src/export_scripts.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1281f9e..a2d19d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,12 +11,12 @@ jobs: test: strategy: matrix: - deno: ['v1.0.0'] + deno: ['v1.0.1'] os: [ubuntu-latest, macOS-latest, windows-latest] runs-on: ${{ matrix.os }} - + steps: - + - uses: actions/checkout@v2 - name: Setup Deno diff --git a/README.md b/README.md index 66774a8..427d5eb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,41 @@ -# Velociraptor +

+ +

-Velociraptor is a script runner for Deno, inspired by npm's package.json scripts. It offers a similar experience but with out-of-the-box support for declarative deno cli options, environment variables, concurrency and (soon) git hooks. +

+ Velociraptor is a script runner for Deno, inspired by npm's package.json scripts. It offers a similar experience but with out-of-the-box support for declarative deno cli options, environment variables, concurrency and (soon) git hooks. +

+ +

+ + + + + + +

+ + + + + +- [Motivation](#motivation) +- [Install](#install) +- [Project status](#project-status) +- [Script files](#script-files) +- [Listing scripts](#listing-scripts) +- [Running scripts](#running-scripts) +- [Exporting scripts](#exporting-scripts) +- [Shell scripting](#shell-scripting) +- [Current working directory](#current-working-directory) +- [Shell completions](#shell-completions) +- [Known limitations](#known-limitations) +- [Upcoming features](#upcoming-features) +- [Contributing](#contributing) +- [License](#license) + + -![Deno CI](https://github.com/umbopepato/velociraptor/workflows/Deno%20CI/badge.svg) -[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/velociraptor@v1.0.0-beta.5/src/scripts_config.ts#ScriptsConfiguration) ## Motivation @@ -12,7 +44,7 @@ Mainly because Deno cli commands can easily become very long and difficult to re ## Install ```sh -$ deno install --allow-read --allow-env --allow-run -n vr https://deno.land/x/velociraptor/cli.ts +$ deno install --allow-read --allow-write --allow-env --allow-run -n vr https://deno.land/x/velociraptor/cli.ts ```
@@ -35,36 +67,20 @@ $ deno install ... https://deno.land/x/velociraptor@/cli.ts For example ```sh -$ deno install --allow-read --allow-env --allow-run -n vr https://deno.land/x/velociraptor@v1.0.0-beta.5/cli.ts +$ deno install --allow-read --allow-write --allow-env --allow-run -n vr https://deno.land/x/velociraptor@v1.0.0-beta.5/cli.ts ```
-## Usage - -```sh -$ vr [SCRIPT] [ADDITIONAL ARGS]... -# or -$ vr run