env-cmd/dist/expand-envs.d.ts
omeid matten 8318637c48 feat: Support env vars expansion in cmd and args
This pull request adds support for expanding environment variable
expansion support. Closes #91

Since the user controls the call site of cmd-env, it only supports
basic UNIX style $var format. `%var%` (windows) or `${var}` is not
supported. However, you can escape variable expansion by escaping
the dollar sign like so `\$`.

Signed-off-by: omeid matten <public@omeid.me>
2019-11-28 16:20:42 +11:00

8 lines
237 B
TypeScript

/**
* expandEnvs Replaces $var in args and command with environment variables
* the environment variable doesn't exist, it leaves it as is.
*/
export declare function expandEnvs(str: string, envs: {
[key: string]: any;
}): string;