mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-08-09 03:07:25 +00:00
Merge pull request #9 from ahmetb/readlink
Fallback to readlink -f on macOS
This commit is contained in:
commit
9a7358ce67
4
kubectx
4
kubectx
@ -21,7 +21,9 @@
|
|||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
SCRIPT_DIR="$(dirname "$( readlink -f "${0}" 2>/dev/null || \
|
||||||
|
python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "${0}" )")"
|
||||||
|
|
||||||
if [[ -f "${SCRIPT_DIR}/utils.bash" ]]; then
|
if [[ -f "${SCRIPT_DIR}/utils.bash" ]]; then
|
||||||
source "${SCRIPT_DIR}/utils.bash"
|
source "${SCRIPT_DIR}/utils.bash"
|
||||||
else
|
else
|
||||||
|
4
kubens
4
kubens
@ -21,7 +21,9 @@
|
|||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
|
SCRIPT_DIR="$(dirname "$( readlink -f "${0}" 2>/dev/null || \
|
||||||
|
python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "${0}" )")"
|
||||||
|
|
||||||
if [[ -f "${SCRIPT_DIR}/utils.bash" ]]; then
|
if [[ -f "${SCRIPT_DIR}/utils.bash" ]]; then
|
||||||
source "${SCRIPT_DIR}/utils.bash"
|
source "${SCRIPT_DIR}/utils.bash"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user