Denox.CLI (denox v0.7.0)

Copy Markdown View Source

Manages a bundled Deno CLI binary.

Disabled by default. Enable by setting the version in config:

config :denox, :cli, version: "2.1.4"

The binary is downloaded from GitHub releases and cached in _build/denox_cli-{version}/deno.

Summary

Functions

Path to the cached deno binary. Downloads if needed.

The configured deno version, or nil if not configured.

Find a deno executable, preferring the system PATH.

Download the configured deno version for this platform.

Check if the binary is already downloaded.

Functions

bin_path()

@spec bin_path() :: {:ok, String.t()} | {:error, term()}

Path to the cached deno binary. Downloads if needed.

Returns {:ok, path} or {:error, reason}.

configured_version()

@spec configured_version() :: String.t() | nil

The configured deno version, or nil if not configured.

find_deno()

@spec find_deno() :: {:ok, String.t()} | {:error, String.t()}

Find a deno executable, preferring the system PATH.

Tries System.find_executable("deno") first, then falls back to the bundled CLI binary via bin_path/0. Returns an actionable error message if neither is available.

install()

@spec install() :: :ok | {:error, term()}

Download the configured deno version for this platform.

Returns :ok or {:error, reason}.

installed?()

@spec installed?() :: boolean()

Check if the binary is already downloaded.