mirror of
https://github.com/toddbluhm/env-cmd.git
synced 2025-12-08 18:23:33 +00:00
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>
8 lines
237 B
TypeScript
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;
|