Skip to content

Commit

Permalink
Merge pull request #132 from amezin/master
Browse files Browse the repository at this point in the history
Make virtualfish work without installation
  • Loading branch information
daisylb committed Jan 2, 2018
2 parents 0d91110 + ba4f16f commit 64f7675
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 7 additions & 3 deletions virtualfish/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@


if __name__ == "__main__":
version = pkg_resources.get_distribution('virtualfish').version
try:
version = pkg_resources.get_distribution('virtualfish').version
commands = ['set -g VIRTUALFISH_VERSION {}'.format(version)]
except pkg_resources.DistributionNotFound:
commands = []

base_path = os.path.dirname(os.path.abspath(__file__))
commands = [
'set -g VIRTUALFISH_VERSION {}'.format(version),
commands += [
'set -g VIRTUALFISH_PYTHON_EXEC {}'.format(sys.executable),
'source {}'.format(os.path.join(base_path, 'virtual.fish')),
]
Expand Down
8 changes: 7 additions & 1 deletion virtualfish/virtual.fish
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,13 @@ function __vf_help --description "Print VirtualFish usage information"
printf " %-15s %s\n" $sc (set_color 555)$helptext(set_color normal)
end
echo
echo "For full documentation, see: http://virtualfish.readthedocs.org/en/$VIRTUALFISH_VERSION/"

if set -q VIRTUALFISH_VERSION
set help_url "http://virtualfish.readthedocs.org/en/$VIRTUALFISH_VERSION/"
else
set help_url "http://virtualfish.readthedocs.org/en/latest/"
end
echo "For full documentation, see: $help_url"
end

function __vf_globalpackages --description "Toggle global site packages"
Expand Down

0 comments on commit 64f7675

Please sign in to comment.