Skip to content

Commit 1b2367d

Browse files
committed
make dirs
1 parent a653aa3 commit 1b2367d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/io/jenkins/plugins/jfrog/JfStep.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ protected String run() throws Exception {
9797
EnvVars env = getContext().get(EnvVars.class);
9898
Run<?, ?> run = getContext().get(Run.class);
9999

100+
workspace.mkdirs();
100101
boolean isWindows = !launcher.isUnix();
101102
String jfrogBinaryPath = getJFrogCLIPath(env, isWindows);
102103
boolean passwordStdinSupported = isPasswordStdinSupported(workspace, env, launcher, jfrogBinaryPath);
@@ -144,6 +145,7 @@ protected String run() throws Exception {
144145
public boolean isPasswordStdinSupported(FilePath workspace, EnvVars env, Launcher launcher, String jfrogBinaryPath) throws IOException, InterruptedException {
145146
TaskListener listener = getContext().get(TaskListener.class);
146147
JenkinsBuildInfoLog buildInfoLog = new JenkinsBuildInfoLog(listener);
148+
147149
boolean isPluginLauncher = launcher.getClass().getName().contains("org.jenkinsci.plugins");
148150
if (isPluginLauncher) {
149151
buildInfoLog.info("Launcher is a plugin launcher. Password stdin is not supported.");
@@ -160,7 +162,10 @@ public boolean isPasswordStdinSupported(FilePath workspace, EnvVars env, Launche
160162
}
161163

162164
static String getJFrogCLIPath(EnvVars env, boolean isWindows) {
165+
// JFROG_BINARY_PATH is set according to the master OS. If not configured, the value of jfrogBinaryPath will
166+
// eventually be 'jf' or 'jf.exe'. In that case, the JFrog CLI from the system path is used.
163167
String jfrogBinaryPath = Paths.get(env.get(JFROG_BINARY_PATH, ""), Utils.getJfrogCliBinaryName(isWindows)).toString();
168+
// Modify jfrogBinaryPath according to the agent's OS
164169
return isWindows ?
165170
FilenameUtils.separatorsToWindows(jfrogBinaryPath) :
166171
FilenameUtils.separatorsToUnix(jfrogBinaryPath);

0 commit comments

Comments
 (0)