Skip to content

Commit

Permalink
resolve output dir using pwd
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Sep 14, 2023
1 parent aa8a1e4 commit 0504984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 6 additions & 4 deletions library_generation/test/generate_library_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ set -xeo pipefail

# defaults
googleapis_gen_url="git@github.com:googleapis/googleapis-gen.git"
script_dir=$(dirname "$(readlink -f "$0")")
source "${script_dir}/../utilities.sh"
library_generation_dir="${script_dir}"/..
output_folder="$(get_output_folder)"

while [[ $# -gt 0 ]]; do
key="$1"
Expand All @@ -38,10 +42,6 @@ esac
shift # past argument or value
done

script_dir=$(dirname "$(readlink -f "$0")")
source "${script_dir}/../utilities.sh"
library_generation_dir="${script_dir}"/..
output_folder="$(get_output_folder)"
mkdir -p "${output_folder}"
pushd "${output_folder}"
# checkout the master branch of googleapis/google (proto files) and WORKSPACE
Expand All @@ -63,6 +63,8 @@ rest_numeric_enums=$(get_rest_numeric_enums_from_BUILD "${proto_build_file_path}
include_samples=$(get_include_samples_from_BUILD "${proto_build_file_path}")
echo "GAPIC options are transport=${transport}, rest_numeric_enums=${rest_numeric_enums}, include_samples=${include_samples}."
# generate GAPIC client library
popd
popd
echo "Generating library from ${proto_path}, to ${destination_path}..."
"${library_generation_dir}"/generate_library.sh \
-p "${proto_path}" \
Expand Down
3 changes: 1 addition & 2 deletions library_generation/utilities.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

set -xeo pipefail
utilities_script_dir=$(echo "${BASH_SOURCE}" | rev | cut -d/ -f2- | rev)


# private functions that should not be called outside this file.
Expand Down Expand Up @@ -330,7 +329,7 @@ get_version_from_versions_txt() {
# relies on utilities_script_dir which points to the same location as
# `generate_library.sh`
get_output_folder() {
echo "${utilities_script_dir}/output"
echo "$(pwd)/output"
}

detect_os_architecture() {
Expand Down

0 comments on commit 0504984

Please sign in to comment.