Merge pull request #717 from hapifhir/gg-202201-npm-path-fix
fix bug in package generator where files go in the wrong place
This commit is contained in:
commit
fec9f68c56
|
@ -1,8 +1,9 @@
|
|||
## Validator Changes
|
||||
|
||||
* fix inclusion of Java constants in CLI help text.
|
||||
* fix bug on `-compile` output when using 'current' version.
|
||||
* no changes
|
||||
|
||||
## Other code changes
|
||||
|
||||
n/a
|
||||
* fix bug where generated packages have files in the wrong places
|
||||
* fix inclusion of Java constants in CLI help text.
|
||||
* fix bug on `-compile` output when using 'current' version.
|
||||
|
|
|
@ -80,14 +80,14 @@ public class NPMPackageGenerator {
|
|||
private String getDirectory() {
|
||||
switch (this) {
|
||||
case RESOURCE: return "package/";
|
||||
case EXAMPLE: return "example/";
|
||||
case OPENAPI: return "openapi/";
|
||||
case SCHEMATRON: return "xml/";
|
||||
case RDF: return "rdf/";
|
||||
case OTHER: return "other/";
|
||||
case TEMPLATE: return "other/";
|
||||
case JEKYLL: return "jekyll/";
|
||||
case TOOL: return "bin/";
|
||||
case EXAMPLE: return "package/example/";
|
||||
case OPENAPI: return "package/openapi/";
|
||||
case SCHEMATRON: return "package/xml/";
|
||||
case RDF: return "package/rdf/";
|
||||
case OTHER: return "package/other/";
|
||||
case TEMPLATE: return "package/other/";
|
||||
case JEKYLL: return "package/jekyll/";
|
||||
case TOOL: return "package/bin/";
|
||||
}
|
||||
return "/";
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ public class NPMPackageGenerator {
|
|||
public void addFile(Category cat, String name, byte[] content) throws IOException {
|
||||
String path = cat.getDirectory()+name;
|
||||
if (path.length() > 100) {
|
||||
name = name.substring(0, name.indexOf("-"))+"-"+UUID.randomUUID().toString();
|
||||
name = name.substring(0, name.indexOf("-"))+"-"+UUID.randomUUID().toString()+".json";
|
||||
path = cat.getDirectory()+name;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue