diff options
Diffstat (limited to 'src/lib/get_type')
-rw-r--r-- | src/lib/get_type | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/get_type b/src/lib/get_type new file mode 100644 index 0000000..9f04b53 --- /dev/null +++ b/src/lib/get_type @@ -0,0 +1,13 @@ +get_type() { + FILE="$1" + CATEGORY="$(echo "$FILE" | grep -Eo "\.[0-9].?\.html$")" + + if [ -n "$CATEGORY" ]; then + case "$CATEGORY" in + .1*) echo "Command" ;; + .2*) echo "Service" ;; + .3*) echo "Function" ;; + *) echo "Object" ;; + esac + fi +} |