updated gcp_info_projects.sh

pull/2/head
Hari Sekhon 4 years ago
parent 8a5187de10
commit 970dc88034

@ -41,17 +41,7 @@ help_usage "$@"
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
project_id="$1" project_id="$1"
shift || : shift || :
current_project="$(gcloud config list --format="value(core.project)")" export CLOUDSDK_CORE_PROJECT="$project_id"
if [ -n "$current_project" ]; then
# want interpolation now not at exit
# shellcheck disable=SC2064
trap "gcloud config set project '$current_project'" EXIT
else
trap "gcloud config unset project" EXIT
fi
gcloud config set project "$project_id"
echo
echo
fi fi

Loading…
Cancel
Save