Skip to content

Commit

Permalink
lib BUGFIX modules without a revision
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Jun 4, 2024
1 parent 2e7c21c commit 6a5671e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ for FILE_PATH in ${NP2_MODULE_DIR}/../tests/modules/*; do

# generate array name, module name, and revision
ARRAY_NAME="$(echo "${FILE}" | tr -- "-@." "_")"
NAME="$(echo "${YANG_FILE}" | cut -d@ -f1)"
REVISION="$(echo "${YANG_FILE}" | cut -d@ -f2)"
REVISION=${REVISION:0:10}
NAME="$(echo "${FILE}" | cut -d@ -f1)"
if [[ "$NAME" == "$FILE" ]]; then
# no revision
NAME="$(echo "${FILE}" | cut -d. -f1)"
REVISION=
else
REVISION="$(echo "${FILE}" | cut -d@ -f2)"
REVISION=${REVISION:0:10}
fi

# generate header file name without the revision
HEADER_FILE="${ARRAY_NAME}.h"
Expand Down

0 comments on commit 6a5671e

Please sign in to comment.