diff options
Diffstat (limited to 'validate/sample-yaml-generator/src/main/java/org/onap')
-rw-r--r-- | validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java b/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java index e18b1d73..9a59cdf6 100644 --- a/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java +++ b/validate/sample-yaml-generator/src/main/java/org/onap/cli/sample/yaml/SampleYamlGenerator.java @@ -16,6 +16,7 @@ package org.onap.cli.sample.yaml; +import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; @@ -27,11 +28,11 @@ public class SampleYamlGenerator { static int nTab; public static void generateSampleYaml(List<String> input, String ouput, String version, - String targetFolder, boolean debug) throws IOException { + String targetPath, boolean debug) throws IOException { String cmdName = input.get(0); - PrintWriter writer = new PrintWriter(targetFolder + "/" + cmdName + "-sample.yaml", "UTF-8"); + PrintWriter writer = new PrintWriter(targetPath, "UTF-8"); writeKeyValuePair(writer, "onap_cli_sample_version", "1.0"); writeKeyValuePair(writer, "name", cmdName); writeKeyValuePair(writer, "version", version); @@ -41,7 +42,7 @@ public class SampleYamlGenerator { writeKeyValuePair(writer, "name", cmdName); writeKeyValuePair(writer, "input", input.stream().skip(1).collect(Collectors.joining(" "))); - writeKeyValuePair(writer, "moco", cmdName + "-sample-yaml.yaml"); + writeKeyValuePair(writer, "moco", new File(targetPath).getName().replaceAll("-sample.yaml", "-moco.json")); writeMultilineKeyValue(writer, "ouput", ouput, debug); writeEndKey(); |