Skip to main content
Module

x/drake/lib.ts

Drake is a make-like task runner for Deno.
Go to Latest
import * as drake from "https://deno.land/x/drake@v1.6.0/lib.ts";

Variables

The Drake env API function gets and optionally sets the command-line options, task names and variables.

Functions

Write an error message to to stderr and terminate execution.

Write the title and message to stderr if it is a TTY and the --debug command-line option was specified or the DRAKE_DEBUG shell environment variable is set.

Return a sorted array of normalized file names matching the wildcard glob patterns. Valid glob patterns are those supported by Deno's path library. Example: glob("tmp/*.ts", "lib/*.ts", "mod.ts");

Log a message to stdout. Do not log the message if the --quiet command-line option is set.

Create directory.

Quote string array values with double-quotes then join them with a separator. Double-quote characters are escaped with a backspace. The separator defaults to a space character.

Read the entire contents of a file synchronously to a UTF-8 string.

Delete files matching the wildcard glob patterns. Example: remove("tmp/*.ts", "lib/*.ts", "mod.ts");

Execute commands asynchronously in the command shell.

Execute command in the command shell and return a promise for {code, output, error} (the exit code, the stdout output and the stderr output).

Return FileInfo (or null if file does not exist).

Find and replace in text file synchronously. If the file contents is unchanged return false. If the contents has changed write it to the file and return true.

Write text to a file synchronously. If the file exists it will be overwritten. Returns true if a new file was created. Returns false if the file already exists.

Interfaces

shCapture API options.

sh API options.