mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
fix reg expression
This commit is contained in:
parent
351833a923
commit
d18426c69a
@ -99,14 +99,20 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
basePath = basePath.replaceAll("[\\\\/]?$", "") + File.separatorChar;
|
||||
}
|
||||
|
||||
String regFirstPathSeparator;
|
||||
if ("/".equals(File.separator)) { // for mac, linux
|
||||
regFirstPathSeparator = "^/";
|
||||
} else { // for windows
|
||||
regFirstPathSeparator = "^\\";
|
||||
}
|
||||
|
||||
return (getPackagePath() + File.separatorChar + basePath
|
||||
// Replace period, backslash, forward slash with file separator in package name
|
||||
+ packageName.replace("\\", File.separator).
|
||||
replace(".", File.separator).replace("/", File.separator));
|
||||
+ packageName.replaceAll("[\\.\\\\/]", File.separator)
|
||||
// Trim prefix file separators from package path
|
||||
//.replaceAll("^" + File.separator, ""))
|
||||
.replaceAll(regFirstPathSeparator, ""))
|
||||
// Trim trailing file separators from the overall path
|
||||
//.replaceAll(File.separator + "$", "");
|
||||
.replaceAll(File.separator + "$", "");
|
||||
}
|
||||
|
||||
public CodegenType getTag() {
|
||||
|
Loading…
Reference in New Issue
Block a user