diff --git a/scripts/download-oas.sh b/scripts/download-oas.sh index f057a06..db43b92 100755 --- a/scripts/download-oas.sh +++ b/scripts/download-oas.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eo pipefail ROOT_DIR=$(git rev-parse --show-toplevel) @@ -19,7 +19,7 @@ if [[ ! ${OAS_REPO} || -d ${OAS_REPO} ]]; then fi if [[ -z ${OAS_API_VERSIONS} ]]; then - echo "No API version passed, using ${ROOTDIR}/api-versions-lock.json" + echo "No API version passed, using ${ROOT_DIR}/api-versions-lock.json" OAS_API_VERSIONS="${ROOT_DIR}/api-versions-lock.json" fi @@ -31,15 +31,15 @@ if [[ ! ${work_dir} || -d {work_dir} ]]; then fi trap "rm -rf ${work_dir}" EXIT # Delete temp directory on exit -if [ -d ${ROOT_DIR}/oas ]; then +if [ -d "${ROOT_DIR}/oas" ]; then echo "OAS folder found. Will be removed" - rm -r ${ROOT_DIR}/oas + rm -r "${ROOT_DIR}/oas" fi # Move oas to root level -mkdir ${ROOT_DIR}/oas -cd ${work_dir} -git clone ${OAS_REPO} --quiet +mkdir "${ROOT_DIR}/oas" +cd "${work_dir}" +git clone "${OAS_REPO}" --quiet for service_dir in ${work_dir}/${OAS_REPO_NAME}/services/*; do diff --git a/scripts/generate-sdk/generate-sdk.sh b/scripts/generate-sdk/generate-sdk.sh index e1e7e56..96d579c 100755 --- a/scripts/generate-sdk/generate-sdk.sh +++ b/scripts/generate-sdk/generate-sdk.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script clones the SDK repo and updates it with the generated API modules # Pre-requisites: Java, goimports, Go set -eo pipefail diff --git a/scripts/generate-sdk/languages/go.sh b/scripts/generate-sdk/languages/go.sh index b23d474..fd95b5f 100644 --- a/scripts/generate-sdk/languages/go.sh +++ b/scripts/generate-sdk/languages/go.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script clones the SDK repo and updates it with the generated API modules # Pre-requisites: Java, goimports, Go set -eo pipefail diff --git a/scripts/generate-sdk/languages/java.sh b/scripts/generate-sdk/languages/java.sh index 0adb37c..9faec0f 100644 --- a/scripts/generate-sdk/languages/java.sh +++ b/scripts/generate-sdk/languages/java.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script clones the SDK repo and updates it with the generated API modules # Pre-requisites: Java set -eo pipefail diff --git a/scripts/generate-sdk/languages/python.sh b/scripts/generate-sdk/languages/python.sh index 4e3ddac..5b021bb 100644 --- a/scripts/generate-sdk/languages/python.sh +++ b/scripts/generate-sdk/languages/python.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script clones the SDK repo and updates it with the generated API modules # Pre-requisites: Java, goimports, Go set -eo pipefail diff --git a/scripts/project.sh b/scripts/project.sh index f9eb69e..4052de4 100755 --- a/scripts/project.sh +++ b/scripts/project.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script is used to manage the project, only used for installing the required tools for now # Usage: ./project.sh [action] diff --git a/scripts/sdk-create-pr.sh b/scripts/sdk-create-pr.sh index 3f14bb9..cbb3706 100755 --- a/scripts/sdk-create-pr.sh +++ b/scripts/sdk-create-pr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script pushes the generated SDK to its repo and creates a PR set -eo pipefail