github.com/aws-cloudformation/cloudformation-cli-go-plugin@v1.2.0/generate-examples.sh (about)

     1  #!/bin/bash
     2  
     3  if [ ! -d "env" ]; then
     4      python3 -m venv env
     5  fi
     6  
     7  function deactivateEnv {
     8      rv=$?
     9      deactivate
    10      exit $?
    11  }
    12  
    13  trap "deactivateEnv" EXIT
    14  
    15  source env/bin/activate
    16  
    17  # uninstall cloudformation-cli-go-plugin if it exists
    18  pip3 show cloudformation-cli-go-plugin
    19  SHOW_RV=$?
    20  
    21  if [ "$SHOW_RV" == "0" ]; then
    22      pip3 uninstall -y cloudformation-cli-go-plugin
    23  fi
    24  
    25  pip3 install -e .
    26  
    27  EXAMPLES=( github-repo )
    28  for EXAMPLE in "${EXAMPLES[@]}"
    29  do
    30      cd examples/$EXAMPLE
    31      cfn generate
    32  done