From e8cdaea5e5d36398d2d32d0a21eae32506ddc092 Mon Sep 17 00:00:00 2001 From: Marcel Kloubert Date: Mon, 1 Jan 2018 06:02:08 +0100 Subject: [PATCH] can get values from env vars now --- CHANGELOG.md | 2 +- package.json | 48 +++++++++++++++++++++++++++++++++++++++++++++++- src/values.ts | 5 +++++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d7dc62..bc3362c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ## 0.11.0 (January 1st, 2018; SFTP and values) -* can load [placeholders](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/values) from files now +* can get [placeholders](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/values) from files and environment variables now * fixed `tryKeyboard` support in [SFTP targets](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/target_sftp) ## 0.10.0 (December 30th, 2017; shell commands, S3 and external sources) diff --git a/package.json b/package.json index 6fe38d0..80930e2 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "license": "LGPL-3.0", "preview": true, "categories": [ + "Azure", "Other" ], "keywords": [ @@ -40663,6 +40664,51 @@ "code" ] }, + { + "type": "object", + "properties": { + "alias": { + "description": "The optional alias to use.", + "type": "string" + }, + "cache": { + "description": "Cache value or not.", + "type": "boolean", + "default": true + }, + "if": { + "description": "(JavaScript) Code, which indicates, if entry is available or not.", + "type": "string" + }, + "name": { + "description": "The name of that value.", + "type": "string" + }, + "platforms": { + "description": "One or more platform names the value is available for.", + "type": "array", + "items": { + "description": "The name of the platform.", + "type": "string", + "enum": [ + "darwin", + "freebsd", + "linux", + "sunos", + "win32" + ] + } + }, + "type": { + "enum": [ + "env", + "environment" + ], + "type": "string", + "description": "A value from a process' environment variable." + } + } + }, { "type": "object", "properties": { @@ -40827,4 +40873,4 @@ "uglify-js": "^3.2.2", "uuid": "^3.1.0" } -} \ No newline at end of file +} diff --git a/src/values.ts b/src/values.ts index 5e36383..4e278ed 100644 --- a/src/values.ts +++ b/src/values.ts @@ -754,6 +754,11 @@ export function loadFromItems(items: WithValueItems, opts?: LoadFromItemsOptions newValue = new CodeValue(VI, NAME); break; + case 'env': + case 'environment': + newValue = new EnvVarValue(NAME, VI); + break; + case 'file': newValue = new FileValue( VI,