Yuta HIGUCHI | 488a94c | 2018-01-26 17:24:09 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
2 | |||||
3 | YANG_ROOT=$1 | ||||
4 | |||||
5 | CONFDC_ARGS=' -c' | ||||
6 | |||||
7 | # YANGPATHS | ||||
8 | for path in $(find $YANG_ROOT -type d); do | ||||
9 | CONFDC_ARGS+=" --yangpath $path" | ||||
10 | done | ||||
11 | |||||
12 | # create output dir | ||||
13 | mkdir -p fxs | ||||
14 | |||||
15 | # compile .yang s | ||||
16 | for yang in $(find $YANG_ROOT -type f -name '*.yang'); do | ||||
17 | BASE=$(basename $yang) | ||||
18 | OUT="${BASE%.yang}.fxs" | ||||
19 | echo "Compiling..$yang" | ||||
20 | confdc $CONFDC_ARGS -o fxs/$OUT -- $yang | ||||
21 | done |