Skip to content

Commit

Permalink
teste
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiobotaro committed Mar 29, 2024
1 parent ec6f10d commit 0383e43
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate diagrams
run: |
/usr/local/structurizr-cli/structurizr.sh export \
-format mermaid \
-workspace relacionamentos/relacionamentos.dsl
run: bash scripts/gerar-diagramas.sh
25 changes: 25 additions & 0 deletions scripts/gerar-diagramas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

function _gerar_markdown() {
arquivo_mmd="$1"
conteudo_mmd=$(cat "$arquivo_mmd")

arquivo_sem_extensao="${arquivo_mmd%.*}"
echo "## ${arquivo_sem_extensao##*-}"
echo ""
echo "\`\`\`mermaid"
echo "$conteudo_mmd"
echo "\`\`\`"
echo ""
}

nome=$1

usr/local/structurizr-cli/structurizr.sh export \
-format mermaid \
-workspace "$nome"/"$nome".dsl

[ -f "$nome"/diagramas.md ] && rm "$nome"/diagramas.md
for arquivo_mmd in "$nome"/*.mmd; do
_gerar_markdown "$arquivo_mmd" >>"$nome"/diagramas.md
done

0 comments on commit 0383e43

Please sign in to comment.