Skip to content

Commit

Permalink
plantuml binary create target dir if matching option
Browse files Browse the repository at this point in the history
  • Loading branch information
fchastanet committed Sep 17, 2024
1 parent eed0e0d commit 5440f22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions bin/plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,11 @@ plantumlCallback() {
if [[ -z "${optionOutputDir}" ]]; then
optionOutputDir="${optionDefaultOutputDir}"
fi
if [[ ! -d "${optionOutputDir}" ]]; then
Log::displayError \
"Command ${SCRIPT_NAME} - output directory '${optionOutputDir}' does not exists"
if [[ ! -d "${optionOutputDir}" && "${sameDirectoryOption}" = "0" ]]; then
if ! mkdir -p "${optionOutputDir}"; then
Log::displayError \
"Command ${SCRIPT_NAME} - failed to create output directory '${optionOutputDir}'"
fi
return 1
fi
}
Expand Down
8 changes: 5 additions & 3 deletions src/_binaries/plantuml/plantuml-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ plantumlCallback() {
if [[ -z "${optionOutputDir}" ]]; then
optionOutputDir="${optionDefaultOutputDir}"
fi
if [[ ! -d "${optionOutputDir}" ]]; then
Log::displayError \
"Command ${SCRIPT_NAME} - output directory '${optionOutputDir}' does not exists"
if [[ ! -d "${optionOutputDir}" && "${sameDirectoryOption}" = "0" ]]; then
if ! mkdir -p "${optionOutputDir}"; then
Log::displayError \
"Command ${SCRIPT_NAME} - failed to create output directory '${optionOutputDir}'"
fi
return 1
fi
}
Expand Down

0 comments on commit 5440f22

Please sign in to comment.