Skip to content

Commit

Permalink
fix: relative path sourcing for asdf-direnv compat (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthegedus committed Feb 28, 2021
1 parent ad3bbfa commit 9b3b917
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
7 changes: 5 additions & 2 deletions bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/helpers.bash
source "$(dirname "$0")/../lib/helpers.bash"
source "${plugin_dir}/lib/helpers.bash"
# shellcheck source=../lib/utils.bash
source "$(dirname "$0")/../lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

download() {
local gcs_bucket_name="cloud-sdk-release"
Expand Down
4 changes: 2 additions & 2 deletions bin/exec-env
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
gcloud_plugin_dir="$(dirname "$(dirname "$current_script_path")")"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/utils.bash
source "${gcloud_plugin_dir}/lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

if [[ ! -x "$(command -v python)" ]]; then
log_failure_and_exit "Python not found and is required for gcloud. Might I suggest https://github.com/danhper/asdf-python"
Expand Down
7 changes: 5 additions & 2 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/helpers.bash
source "$(dirname "$0")/../lib/helpers.bash"
source "${plugin_dir}/lib/helpers.bash"
# shellcheck source=../lib/utils.bash
source "$(dirname "$0")/../lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

install_gcloud() {
tmp_download_dir=$(mktemp -d -t 'asdf_gcloud_XXXXXX')
Expand Down
5 changes: 4 additions & 1 deletion bin/post-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/utils.bash
source "$(dirname "$0")/../lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

function default_cloud_sdk_components_config_path() {
local default_components_filename=".default-cloud-sdk-components"
Expand Down
5 changes: 4 additions & 1 deletion bin/post-plugin-add
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/utils.bash
source "$(dirname "$0")/../lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

check_dependencies "$(dirname "$0")/../lib/dependencies.txt" "warning"
5 changes: 4 additions & 1 deletion bin/pre-plugin-remove
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/utils.bash
source "$(dirname "$0")/../lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

# Google Cloud SDK uninstall instructions - https://cloud.google.com/sdk/docs/uninstall-cloud-sdk

Expand Down
5 changes: 4 additions & 1 deletion bin/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

set -euo pipefail

current_script_path="${BASH_SOURCE[0]}"
plugin_dir="$(dirname "$(dirname "$current_script_path")")"

# shellcheck source=../lib/utils.bash
source "$(dirname "$0")/../lib/utils.bash"
source "${plugin_dir}/lib/utils.bash"

# Google Cloud SDK uninstall instructions - https://cloud.google.com/sdk/docs/uninstall-cloud-sdk

Expand Down

0 comments on commit 9b3b917

Please sign in to comment.