Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Detect what version of python is installed #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion functions/__kube_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ function __kube_ps_update_cache
end

function __stat_mtime
# Get installed python executable
set python (which -a python python2 python2.7 python3 python3.6 | head -n 1)

#-- cross-platform workaround; POSIX didn't specify stat(1) and so
#-- its interface is incompatibly different on Mac OS and Linux.
#-- see https://unix.stackexchange.com/q/561927/3097
python -c "print(__import__('os').stat(__import__('sys').argv[1]).st_mtime)" $argv
$python -c "print(__import__('os').stat(__import__('sys').argv[1]).st_mtime)" $argv
end

set -l kubeconfig "$KUBECONFIG"
Expand Down