Skip to content

Commit

Permalink
Improve script to remove all files before generation
Browse files Browse the repository at this point in the history
  • Loading branch information
violog committed Jul 5, 2024
1 parent 316a640 commit 306226d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ function parseArgs {

function generate {
(cd docs && npm run build)
if [[ ! -d "${GENERATED}" ]]; then
mkdir -p "${GENERATED}"
else
rm -rf "${GENERATED}"/*
fi
docker run --rm -v "${OPENAPI_DIR}":/openapi -v "${GENERATED}":/generated "${GENERATOR_IMAGE}" \
generate -pkg "${PACKAGE_NAME}" --raw-formats-as-types --meta-for-lists
goimports -w ${GENERATED}
Expand Down

0 comments on commit 306226d

Please sign in to comment.