Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
added userName build-in value
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed May 29, 2017
1 parent ed2bbf0 commit a843104
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* added `alwaysShowPackageList` setting that indicates if package list is shown, even if there is only 1 entry
* added `alwaysShowTargetList` setting that indicates if target list is shown, even if there is only 1 entry
* added `username` and `password` settings for [HTTP target operations](https://github.com/mkloubert/vs-deploy/wiki/targetoperations#http-)
* added build-in [placeholders](https://github.com/mkloubert/vs-deploy/wiki/values) `EOL`, `hostName` and `tempDir`
* added `runBuildTaskOnStartup` that can defines if `workbench.action.tasks.build` command (build task) should be run on startup or not
* added `runGitPullOnStartup` that can defines if `git.pull` command should be run on startup or not
* added build-in [placeholders](https://github.com/mkloubert/vs-deploy/wiki/values) `EOL`, `hostName`, `tempDir`, `userName`
* added `runBuildTaskOnStartup` which defines if `workbench.action.tasks.build` command (build task) should be run on startup or not
* added `runGitPullOnStartup`, which defines if `git.pull` command should be run on startup or not
* lots of code improvements

## 9.10.0 (May 28th, 2017; new list target)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dropbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function toDropboxPath(path: string): string {

// remote ending path separators
while ((result.length) > 0 &&
(result.lastIndexOf(PATH_SEP) == (result.length - 1))) {
(result.lastIndexOf(PATH_SEP) === (result.length - 1))) {
result = result.substr(0, result.length - 1).trim();
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class RemotePlugin extends deploy_objects.DeployPluginWithContextBase<RemoteCont
err = new Error(allErrors.map((x, i) => i18.t('errors.countable', i + 1, x))
.join('\n\n'));
}
else if (1 == allErrors.length) {
else if (1 === allErrors.length) {
err = allErrors[0];
}

Expand Down Expand Up @@ -254,7 +254,7 @@ class RemotePlugin extends deploy_objects.DeployPluginWithContextBase<RemoteCont
return;
}

while (0 == relativePath.indexOf('/')) {
while (0 === relativePath.indexOf('/')) {
relativePath = relativePath.substr(1);
}

Expand All @@ -280,7 +280,7 @@ class RemotePlugin extends deploy_objects.DeployPluginWithContextBase<RemoteCont
try {
let remoteFile: RemoteFile = {
isFirst: 1 === ctx.counter,
isLast: ctx.counter == ctx.totalCount,
isLast: ctx.counter === ctx.totalCount,
name: <string>relativePath,
nr: ctx.counter,
session: ctx.session,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/s3bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ class S3BucketPlugin extends deploy_objects.DeployPluginWithContextBase<S3Contex
}

let dir = deploy_helpers.toStringSafe(target.dir).trim();
while ((dir.length > 0) && (0 == dir.indexOf('/'))) {
while ((dir.length > 0) && (0 === dir.indexOf('/'))) {
dir = dir.substr(1).trim();
}
while ((dir.length > 0) && ((dir.length - 1) == dir.lastIndexOf('/'))) {
while ((dir.length > 0) && ((dir.length - 1) === dir.lastIndexOf('/'))) {
dir = dir.substr(0, dir.length - 1).trim();
}
dir += '/';
Expand Down
9 changes: 9 additions & 0 deletions src/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,15 @@ export function getBuildInValues(): ValueBase[] {
}));
}

// ${userName}
{
objs.push(new CodeValue({
name: 'userName',
type: "code",
code: "require('os').userInfo().username",
}));
}

// ${workspaceRoot}
{
objs.push(new CodeValue({
Expand Down

0 comments on commit a843104

Please sign in to comment.