GithubHelp home page GithubHelp logo

Comments (8)

ahmetb avatar ahmetb commented on May 14, 2024 1

Fixed, try with brew update && brew upgrade.

from kubectx.

lypht avatar lypht commented on May 14, 2024

@koenrh I just ran into this myself. The following resolved my local instance:

brew install coreutils

I then added gnubin to my path by appending

export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" to $HOME/.bash_profile, and restarting my terminal.

I agree that the additional case requirement would be a helpful addition, but until that point, if others are using this fantastic tool, these three steps might help some folks.

from kubectx.

ahmetb avatar ahmetb commented on May 14, 2024

My bad. I keep forgetting gnu coreutils is installed on my Mac. I wonder if we can do without -f and without checking for greadlink.

from kubectx.

rfay avatar rfay commented on May 14, 2024

In the brew recipe you might be able to make coreutils a dependency and then use greadlink? Seems like a hard sell.

from kubectx.

ahmetb avatar ahmetb commented on May 14, 2024

Since readlink -f fails only on BSD coreutils which is on mac, I think we can safely assume Python is installed. So I am changing the way to determine SCRIPT_DIR to this, which falls back to Python:

SCRIPT_DIR="$(dirname $( readlink -f "${0}" 2>/dev/null || \
  python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "${0}" ))"

Every method I found without introducing GNU coreutils dependency is just a hack, including this one. Iโ€™ll submit a PR soon and make a release. Sorry for the disruption.

from kubectx.

koenrh avatar koenrh commented on May 14, 2024

@ahmetb What do think of this? https://github.com/kubernetes/kubernetes/blob/b353700bfc1ee95b8f9f827c9cc818cf2ab3f943/hack/lib/init.sh#L111-L128

from kubectx.

ahmetb avatar ahmetb commented on May 14, 2024

@koenrh it's nice but we would be copying it to 2 files, both kubens/kubectx scripts. So I prefer a one-liner more.

from kubectx.

rfay avatar rfay commented on May 14, 2024

Works for me, thanks!

from kubectx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.