Skip to content

Commit

Permalink
Fix a problem with the model validation
Browse files Browse the repository at this point in the history
  • Loading branch information
LuLeRoemer committed Jun 7, 2023
1 parent 8a5c994 commit 9270edd
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/actions/model-validation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ async function gatherValidationResults(startPath, fileEnding, returnValue) {
async function validateChanges(added, modified, prNumber) {
var validationOutput = []

added = added.filter(fileName => fileName.endsWith('.ttl'))
modified = modified.filter(fileName => fileName.endsWith('.ttl'))

await validateAllInputs(added, modified, validationOutput)

console.log(validationOutput)
Expand Down Expand Up @@ -126,20 +129,18 @@ async function validateAllInputs(added, modified, validationOutput) {

async function validateModel(file) {
return new Promise((resolve, reject) => {
if (path.extname(file) === ".ttl") {
console.log(`Validating TTL file ${file}`)
console.log(`Validating TTL file ${file}`)

exec(`java -jar ${bammSdkPath} aspect ${file} validate`, (error, stdout, stderr) => {
if (stderr) {
reject(stderr)
}
exec(`java -jar ${bammSdkPath} aspect ${file} validate`, (error, stdout, stderr) => {
if (stderr) {
reject(stderr)
}

resolve({
file: file,
response: stdout
})
resolve({
file: file,
response: stdout
})
}
})
})

}
Expand Down

0 comments on commit 9270edd

Please sign in to comment.