Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions build/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,36 @@ printf "OWASP Markdown Conversion Tool\n"

BOMTYPE=;

shopt -s nocasematch
case $1 in
([Ss][Bb][Oo][Mm]) BOMTYPE="SBOM";;
([Cc][Bb][Oo][Mm]) BOMTYPE="CBOM";;
([Ss][Aa][Aa][Ss][Bb][Oo][Mm]) BOMTYPE="SaaSBOM";;
([Vv][Dd][Rr]) BOMTYPE="VDR_VEX";;
([Vv][Ee][Xx]) BOMTYPE="VDR_VEX";;
([Aa][Tt][Tt][Ee][Ss][Tt][Aa][Tt][Ii][Oo][Nn][Ss]) BOMTYPE="Attestations";;
([Mm][Ll][Bb][Oo][Mm]) BOMTYPE="ML-BOM";;
([Mm][Bb][Oo][Mm]) BOMTYPE="MBOM";;
([Hh][Bb][Oo][Mm]) BOMTYPE="HBOM";;
(*)
echo Invalid argument. Valid arguments are "SBOM", "CBOM", "SaaSBOM", "MLBOM", "MBOM", "HBOM", "VDR", and "Attestations"
exit;;
"SBOM" )
BOMTYPE="SBOM"
;;
"CBOM" )
BOMTYPE="CBOM"
;;
"SaaSBOM" )
BOMTYPE="SaaSBOM"
;;
"VDR" | "VEX" | "VDR_VEX" | "VDR+VEX" )
BOMTYPE="VDR_VEX"
;;
"Attestations" )
BOMTYPE="Attestations"
;;
"ML-BOM" | "MLBOM")
BOMTYPE="ML-BOM"
;;
"MBOM" )
BOMTYPE="MBOM"
;;
"HBOM" )
BOMTYPE="HBOM"
;;
* )
echo 'Invalid argument. Valid arguments are "SBOM", "CBOM", "SaaSBOM", "MLBOM", "MBOM", "HBOM", "VDR", and "Attestations"'
exit 1
;;
esac

printf "Task: Generate CycloneDX $BOMTYPE guide\n"
Expand All @@ -26,7 +43,7 @@ function command_exists () {

if ! command_exists pandoc; then
printf "Error: Please install pandoc. Cannot continue"
exit;
exit 2;
fi

generate_docx() {
Expand Down
29 changes: 20 additions & 9 deletions generate-document.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@ echo "OWASP Markdown Conversion Tool"

BOMTYPE=;

shopt -s nocasematch
case $1 in
([Ss][Bb][Oo][Mm]) BOMTYPE="SBOM";;
([Cc][Bb][Oo][Mm]) BOMTYPE="CBOM";;
([Ss][Aa][Aa][Ss][Bb][Oo][Mm]) BOMTYPE="SaaSBOM";;
([Vv][Dd][Rr]) BOMTYPE="VDR+VEX";;
([Vv][Ee][Xx]) BOMTYPE="VDR+VEX";;
([Aa][Tt][Tt][Ee][Ss][Tt][Aa][Tt][Ii][Oo][Nn][Ss]) BOMTYPE="Attestations";;
(*)
"SBOM" )
BOMTYPE="SBOM"
;;
"CBOM" )
BOMTYPE="CBOM"
;;
"SaaSBOM" )
BOMTYPE="SaaSBOM"
;;
"VDR" | "VEX" | "VDR_VEX" | "VDR+VEX" )
BOMTYPE="VDR+VEX"
;;
"Attestations" )
BOMTYPE="Attestations"
;;
* )
echo Invalid argument. Valid arguments are "SBOM", "CBOM", "SaaSBOM", "VDR", and "Attestations"
exit;;
exit 1
;;
esac

echo -n "Task: Generate CycloneDX $BOMTYPE guide"
Expand All @@ -24,7 +35,7 @@ function command_exists () {

if ! command_exists pandoc; then
echo "Error: Please install pandoc. Cannot continue"
exit;
exit 2;
fi

generate_docx() {
Expand Down