From e9d8f1645d854cc41c507c57263b728ad6740e03 Mon Sep 17 00:00:00 2001 From: Gustavo Pantuza Coelho Pinto Date: Fri, 26 May 2017 18:59:07 -0300 Subject: [PATCH 1/3] Pyenv function: Create initialization of Pyenv --- init.fish | 3 --- pyenv-init.fish | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) delete mode 100644 init.fish create mode 100644 pyenv-init.fish diff --git a/init.fish b/init.fish deleted file mode 100644 index e2a011e..0000000 --- a/init.fish +++ /dev/null @@ -1,3 +0,0 @@ -set -q PYENV_ROOT; or set -l PYENV_ROOT $HOME/.pyenv - -set PATH $PYENV_ROOT/shims $PYENV_ROOT/bin $PATH diff --git a/pyenv-init.fish b/pyenv-init.fish new file mode 100644 index 0000000..d719331 --- /dev/null +++ b/pyenv-init.fish @@ -0,0 +1,16 @@ + +function pyenv-init --description "Pyenv inicialization script for fish shell" + + # Checks if directories already exists. If not, creates then + for dir in "shims" "bin" + if not test -d $HOME/pyenv/$dir + mkdir -p $HOME/pyenv/$dir + end + end + + # Respects if PYENV_ROOT exists. Otherwise, sets it to a default directory + set --query PYENV_ROOT; or set --local PYENV_ROOT $HOME/.pyenv + + # Appends PYENV_ROOT directories to PATH variable + set PATH $PYENV_ROOT/shims $PYENV_ROOT/bin $PATH +end From 70597c9a936f7ba6920d7ae157c09fe18f47e466 Mon Sep 17 00:00:00 2001 From: Gustavo Pantuza Date: Fri, 26 May 2017 19:43:24 -0300 Subject: [PATCH 2/3] Readme: Create base documentation of how to use plugin --- README.md | 28 ++++++++++++++++++++++++++++ pyenv-init.fish | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c00462 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ + + + +# Pyenv Plugin for Fish Shell +Use [Pyenv](https://github.com/pyenv/pyenv) with [fish shell](https://fishshell.com) managed by [Oh my fish](https://github.com/oh-my-fish/oh-my-fish) in a very simple way! + +
+
+ +## Installation + +```fish +omf update # Just if your omf installation is old. Avoids missing the package +omf install pyenv +``` +> omf (Oh my fish) is a package manager for fish shell. Just like pip is for Python and gem is for Ruby + +## Usage + +Just add the following line in your ```config.fish``` file: + +```fish +# Initializes Pyenv +pyenv-init +``` + +This will initialize pyenv every time a new Fish session starts. +And that is all! diff --git a/pyenv-init.fish b/pyenv-init.fish index d719331..a69cf56 100644 --- a/pyenv-init.fish +++ b/pyenv-init.fish @@ -1,5 +1,5 @@ -function pyenv-init --description "Pyenv inicialization script for fish shell" +function pyenv-init --description "Pyenv initialization script for fish shell" # Checks if directories already exists. If not, creates then for dir in "shims" "bin" From 7f988515abb971c4d0c1124ed235694bef9ce21a Mon Sep 17 00:00:00 2001 From: Gustavo Pantuza Date: Fri, 26 May 2017 19:51:19 -0300 Subject: [PATCH 3/3] Fish structure: Add pyenv-init script in functions directory --- pyenv-init.fish => functions/pyenv-init.fish | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pyenv-init.fish => functions/pyenv-init.fish (100%) diff --git a/pyenv-init.fish b/functions/pyenv-init.fish similarity index 100% rename from pyenv-init.fish rename to functions/pyenv-init.fish