Skip to content

Commit

Permalink
Merge branch 'skundrik-JENKINS-17541-target-directory-does-not-expand…
Browse files Browse the repository at this point in the history
…-token-macro-parameters' [FIXED JENKINS-17541]
  • Loading branch information
imod committed Sep 10, 2015
2 parents c9995fc + fa84325 commit 5b6c671
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -122,6 +122,7 @@ private boolean download(AbstractBuild<?, ?> build, BuildListener listener, fina
final String groupId = TokenMacro.expandAll(build, listener, a.getGroupId());
final String extension = TokenMacro.expandAll(build, listener, a.getExtension());
final String targetFileName = TokenMacro.expandAll(build, listener, a.getTargetFileName());
final String expandedTargetDirectory = TokenMacro.expandAll(build, listener, getTargetDirectory());

String version = TokenMacro.expandAll(build, listener, a.getVersion());
version = checkVersionOverride(build, listener, groupId, artifactId, version);
Expand All @@ -133,7 +134,7 @@ private boolean download(AbstractBuild<?, ?> build, BuildListener listener, fina

String fileName = StringUtils.isBlank(targetFileName) ? file.getName() : targetFileName;
FilePath source = new FilePath(file);
String targetDir = StringUtils.isNotBlank(getTargetDirectory()) ? getTargetDirectory() + "/" : "";
String targetDir = StringUtils.isNotBlank(expandedTargetDirectory) ? expandedTargetDirectory + "/" : "";
FilePath target = new FilePath(build.getWorkspace(), targetDir + fileName);
boolean wasDeleted = target.delete();
if (wasDeleted) {
Expand Down

0 comments on commit 5b6c671

Please sign in to comment.