fix[pb]: if not specify output path, then use current default path

This commit is contained in:
godotg
2024-01-16 13:46:23 +08:00
parent c57656b851
commit f463205bcb
@@ -48,7 +48,12 @@ public abstract class GeneratePbUtils {
public static final int COMPATIBLE_FIELD_TAG = 1000;
public static void create(PbGenerateOperation pbGenerateOperation) {
protocolOutputPath = FileUtils.joinPath(pbGenerateOperation.getOutputPath(), protocolOutputRootPath);
// if not specify output path, then use current default path
if (StringUtils.isBlank(pbGenerateOperation.getOutputPath())) {
protocolOutputPath = FileUtils.joinPath(pbGenerateOperation.getOutputPath(), protocolOutputRootPath);
} else {
protocolOutputPath = pbGenerateOperation.getOutputPath();
}
// java package path
if (StringUtils.isNotEmpty(pbGenerateOperation.getJavaPackage())) {
protocolOutputPath = protocolOutputPath + File.separator + pbGenerateOperation.getJavaPackage().replaceAll(StringUtils.PERIOD_REGEX, "/");