Skip to content

Commit

Permalink
Make sure generate.sh has docker running before trying to generate, a…
Browse files Browse the repository at this point in the history
…nd make the script always execute in the correct directory (#9649)
  • Loading branch information
noahkawasakigoogle authored Jan 20, 2022
1 parent 9fe804a commit d2d0335
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions airbyte-integrations/connector-templates/generator/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ error_handler() {
trap 'error_handler $LINENO' ERR

set -e

# Ensure script always runs from this directory because thats how docker build contexts work
cd "$(dirname "${0}")" || exit 1

# Make sure docker is running before trying
if ! docker ps; then
echo "docker is not running, this script requires docker to be up"
echo "please start up the docker daemon!"
exit
fi

_UID=$(id -u)
_GID=$(id -g)
# Remove container if already exist
Expand All @@ -28,5 +39,3 @@ else
fi

echo "Finished running generator"

exit 0

0 comments on commit d2d0335

Please sign in to comment.