mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-03 18:09:08 +00:00
fix problem with version dependencies when loading npm packages directly in validator
This commit is contained in:
parent
de7dc3023d
commit
f9e11e22c1
@ -105,6 +105,14 @@ public class IgLoader implements IValidationEngineLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NpmPackage npm = srcPackage.matches(FilesystemPackageCacheManager.PACKAGE_VERSION_REGEX_OPT) && !new File(srcPackage).exists() ? getPackageCacheManager().loadPackage(srcPackage, null) : null;
|
NpmPackage npm = srcPackage.matches(FilesystemPackageCacheManager.PACKAGE_VERSION_REGEX_OPT) && !new File(srcPackage).exists() ? getPackageCacheManager().loadPackage(srcPackage, null) : null;
|
||||||
|
if (npm == null && new File(srcPackage).exists()) {
|
||||||
|
// try treating the file as an npm
|
||||||
|
try {
|
||||||
|
npm = NpmPackage.fromPackage(new FileInputStream(srcPackage));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// nothing - any errors will be properly handled later in the process
|
||||||
|
}
|
||||||
|
}
|
||||||
if (npm != null) {
|
if (npm != null) {
|
||||||
for (String s : npm.dependencies()) {
|
for (String s : npm.dependencies()) {
|
||||||
if (!getContext().getLoadedPackages().contains(s)) {
|
if (!getContext().getLoadedPackages().contains(s)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user