#!/bin/bash # Copyright ETSI 2020 echo "------ Switching to $1 folder --------" cd $1 echo "------ Content of the folder ------" ls echo "------ Validating all YANG, JSON and XML files ------" # If there are no YANG, JSON or XML files, then simply exit ls | grep -q 'yang\|json\|xml\|xsd' found_data_models=$? if [ ! $found_data_models ] ; then echo "-- No YANG, JSON, XML or XSD files." exit 0 fi # This must run error-free and must display all warnings to the user docker run --rm -v $(pwd)/yang-models:/yang hellt/pyang "/bin/sh" -c 'pyang --strict -p external-yams _3gpp-*.yang' ret=$? exit $ret