Skip to content

Instantly share code, notes, and snippets.

@colstrom
Last active December 9, 2016 19:08
Show Gist options
  • Select an option

  • Save colstrom/233bcc9b044fe8e8a058d6f0850319cc to your computer and use it in GitHub Desktop.

Select an option

Save colstrom/233bcc9b044fe8e8a058d6f0850319cc to your computer and use it in GitHub Desktop.
gistpkg-install.fish: installs packages from gists
function gistpkg-install --argument package
set --local package (gistpkg-config root)/(sanitize-git-remote-url $package)
test (is-a-directory (gistpkg-config fish/functions)) = false
and mkdir -p (gistpkg-config fish/functions)
if test (count $package/*.fish) -eq 0
printf "%s contains no .fish files" $package
return 0
end
ln -sf $package/*.fish (gistpkg-config fish/functions)/
end
name = gistpkg-install
author = Chris Olstrom
license = MIT
provides = fish/functions/gistpkg-install
requires
command/ln
command/mkdir
fish/builtin/and
fish/builtin/count
fish/builtin/end
fish/builtin/false
fish/builtin/function
fish/builtin/if
fish/builtin/printf
fish/builtin/return
fish/builtin/set
fish/builtin/test
fish/functions/gistpkg-config
fish/functions/is-a-directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment