Skip to content

Commit

Permalink
Merge pull request #4132 from rstudio/bugfix/job-name-vs-script-name-…
Browse files Browse the repository at this point in the history
…pro-merge

companion to rstudio/rstudio-pro#804
  • Loading branch information
gtritchie committed Jan 9, 2019
2 parents cc8f482 + 882aac5 commit b19c757
Showing 1 changed file with 13 additions and 8 deletions.
Expand Up @@ -71,14 +71,7 @@ protected JobLaunchSpec collectInput()
String jobName;
if (source_ == JobSource.Selection)
{
if (StringUtil.isNullOrEmpty(controls_.scriptPath()))
{
jobName = "Current selection";
}
else
{
jobName = FileSystemItem.getNameFromPath(controls_.scriptPath()) + " selection";
}
jobName = computeSelectionJobName(controls_.scriptPath());
}
else
{
Expand Down Expand Up @@ -118,6 +111,18 @@ protected Widget createMainWidget()
return controls_;
}

public static String computeSelectionJobName(String path)
{
if (StringUtil.isNullOrEmpty(path))
{
return "Current selection";
}
else
{
return FileSystemItem.getNameFromPath(path) + " selection";
}
}

private final String code_;
private final JobSource source_;
private JobLauncherControls controls_;
Expand Down

0 comments on commit b19c757

Please sign in to comment.