CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-grunt-env

Grunt plugin for specifying environment variable configurations in task chains

81

0.98x
Overview
Eval results
Files

task.mdevals/scenario-1/

Build Environment Directives

Configure Grunt to expose environment targets that reshape PATH and SERVICE_FLAGS by prepending, appending, and concatenating values with explicit delimiters. Each target should be runnable on its own (env:tools, env:projectBins, env:runtimeFlags) or in sequence to produce the described merged environment, relying on the dependency's directive-based merges instead of manual string assembly.

Capabilities

Prepend tool binaries

  • With PATH="/usr/bin:/bin" before execution, running the env:tools target results in PATH="/opt/tools/bin:/usr/bin:/bin", keeping the original ordering intact. @test

Append project bins

  • With PATH="/usr/bin:/bin" before execution, running the env:projectBins target results in PATH="/usr/bin:/bin:node_modules/.bin", using : as the delimiter between existing and appended entries. @test

Concat runtime flags

  • With SERVICE_FLAGS="core" before execution, running the env:runtimeFlags target results in SERVICE_FLAGS="core;beta;gamma", using ; as the delimiter between values. @test

Combined chain

  • Running env:tools, then env:projectBins, then env:runtimeFlags leaves PATH="/opt/tools/bin:/usr/bin:/bin:node_modules/.bin" and SERVICE_FLAGS="core;beta;gamma" at the end of the chain. @test

Implementation

@generates

API

module.exports = function (grunt);

Dependencies { .dependencies }

grunt { .dependency }

Task runner used to load and invoke environment configuration.

grunt-env { .dependency }

Provides environment merging directives for prepending, appending, and concatenating variables with delimiters.

Install with Tessl CLI

npx tessl i tessl/npm-grunt-env

tile.json