Skip to content

Commit

Permalink
feat(run): add .js support to compact run
Browse files Browse the repository at this point in the history
  • Loading branch information
umbopepato committed Jun 5, 2020
1 parent 429a0d5 commit 4226144
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -14,6 +14,7 @@
<a href="#badge"><img alt="vr scripts" src="https://badges.velociraptor.run/flat.svg"/></a>
<a href="https://doc.deno.land/https/deno.land/x/velociraptor@v1.0.0-beta.9/src/scripts_config.ts#ScriptsConfiguration"><img src="https://img.shields.io/badge/deno-doc-blue?logo=deno"></a>
<a href="https://deno.land"><img src="https://img.shields.io/badge/deno-%5E1.0.0-green?logo=deno"/></a>
<a href="https://discord.gg/ZYFdXb"><img src="https://img.shields.io/badge/join-chat-7289DA?logo=discord&logoColor=white"/></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen"/></a>

</p>
Expand Down Expand Up @@ -112,7 +113,7 @@ In its simplest form, the `scripts` property behaves like in package.json: the k

### Compact deno run

When a command starts with a `.ts` file, `deno run` is automatically prepended:
When a command starts with a `.ts` or `.js` file, `deno run` is automatically prepended:

```yaml
scripts:
Expand Down
2 changes: 1 addition & 1 deletion src/build_command_string.ts
Expand Up @@ -109,6 +109,6 @@ function matchDenoCommand(command: string) {

function matchCompactRun(command: string) {
return command.match(
/^'(?:\\'|.)*?\.ts'|^"(?:\\"|.)*?\.ts"|^(?:\\\ |\S)+\.ts/,
/^'(?:\\'|.)*?\.[tj]s'|^"(?:\\"|.)*?\.[tj]s"|^(?:\\\ |\S)+\.[tj]s/,
);
}

0 comments on commit 4226144

Please sign in to comment.