You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/helper/validate-yml

18 lines
639 B

#!/usr/bin/perl -CSD
# Purpose: validate yml file format
################################################################################
use strict;
use warnings;
use YAML::Tiny;
use File::Temp qw/tempfile/;
my $yaml = YAML::Tiny->new;
my $inputfile = shift or die 'You did not specify an input file name';
my $outputfile = new File::Temp( UNLINK => 1 );
$yaml = YAML::Tiny->read($inputfile);
open(my $fh, '>', "$outputfile") or die "Could not open $outputfile for writing";
print $fh $yaml->write_string() or die "Could not write YAML to $outputfile";
## END OF FILE #################################################################