diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5b144..0518d25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log (vs-deploy) +## 9.34.0 (October 8th, 2017; placeholders in arguments of 'open' operations) + +* added `usePlaceholdersInArguments` for [open](https://github.com/mkloubert/vs-deploy/wiki/targetoperations#open-) deploy operations + ## 9.33.0 (October 5th, 2017; placeholders in SFTP targets) * `dir` property of [sftp targets](https://github.com/mkloubert/vs-deploy/wiki/target_sftp) now supports [placeholders](https://github.com/mkloubert/vs-deploy/wiki/values) diff --git a/package.json b/package.json index f45639e..30be072 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vs-deploy", "displayName": "Deploy", "description": "Commands for deploying files of your workspace to a destination.", - "version": "9.33.0", + "version": "9.34.0", "publisher": "mkloubert", "engines": { "vscode": "^1.6.0" @@ -1681,6 +1681,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -2284,6 +2289,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -3126,6 +3136,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -3729,6 +3744,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -4554,6 +4574,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -5157,6 +5182,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -5944,6 +5974,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -6547,6 +6582,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -7361,6 +7401,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -7964,6 +8009,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -8786,6 +8836,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -9389,6 +9444,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -10311,6 +10371,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -10914,6 +10979,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -11751,6 +11821,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -12354,6 +12429,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -13149,6 +13229,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -13752,6 +13837,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -14607,6 +14697,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -15210,6 +15305,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -16043,6 +16143,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -16646,6 +16751,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -17443,6 +17553,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -18046,6 +18161,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -18835,6 +18955,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -19438,6 +19563,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -20375,6 +20505,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -20978,6 +21113,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -21793,6 +21933,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -22396,6 +22541,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -23289,6 +23439,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -23892,6 +24047,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -25159,6 +25319,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -25762,6 +25927,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -26548,6 +26718,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -27151,6 +27326,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -27966,6 +28146,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -28569,6 +28754,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -29354,6 +29544,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -30756,6 +30951,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, @@ -31359,6 +31559,11 @@ "description": "Also use environment variables of the process of current workspace or not.", "type": "boolean", "default": false + }, + "usePlaceholdersInArguments": { + "description": "Use placeholders in arguments or not.", + "type": "boolean", + "default": false } } }, diff --git a/src/contracts.ts b/src/contracts.ts index 5decfca..1b51cc1 100644 --- a/src/contracts.ts +++ b/src/contracts.ts @@ -1116,6 +1116,10 @@ export interface DeployOpenOperation extends DeployOperation, ProcessObject { * The application / target to open. */ target?: string; + /** + * Use placeholders in arguments or not. + */ + usePlaceholdersInArguments?: boolean; /** * Wait until target has been executed or not. */ diff --git a/src/operations.ts b/src/operations.ts index dc63e5a..6136ae8 100644 --- a/src/operations.ts +++ b/src/operations.ts @@ -551,6 +551,16 @@ export function http(ctx: OperationContext export function open(ctx: OperationContext): Promise { let me: vs_deploy.Deployer = this; + const GET_FINAL_ARGS = (argList: string[]) => { + if (deploy_helpers.toBooleanSafe(ctx.operation.usePlaceholdersInArguments)) { + argList = argList.map(a => { + return me.replaceWithValues(a); + }); + } + + return argList; + }; + return new Promise((resolve, reject) => { let completed = deploy_helpers.createSimplePromiseCompletedAction(resolve, reject); @@ -564,7 +574,7 @@ export function open(ctx: OperationContext let args = deploy_helpers.asArray(openOperation.arguments) .map(x => deploy_helpers.toStringSafe(x)) - .filter(x => x); + .filter(x => '' !== x); let terminalName = '[vs-deploy]'; if (!deploy_helpers.isEmptyString(openOperation.name)) { @@ -579,7 +589,7 @@ export function open(ctx: OperationContext app = Path.resolve(app); let terminal = vscode.window.createTerminal(terminalName, - app, args); + app, GET_FINAL_ARGS(args)); terminal.show(); } else { @@ -588,7 +598,7 @@ export function open(ctx: OperationContext openArgs = openArgs.concat(deploy_helpers.asArray(openOperation.arguments)); } openArgs = openArgs.map(x => deploy_helpers.toStringSafe(x)) - .filter(x => x); + .filter(x => '' !== x); if (openArgs.length > 0) { let app = operationTarget; @@ -601,7 +611,7 @@ export function open(ctx: OperationContext ctx.outputChannel.append(i18.t('deploy.operations.open', operationTarget)); deploy_helpers.open(operationTarget, { - app: openArgs, + app: GET_FINAL_ARGS(openArgs), env: deploy_helpers.makeEnvVarsForProcess(openOperation, me.getValues()), wait: waitForExit, }).then(function() {