Skip to content

Instantly share code, notes, and snippets.

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

  • Save colstrom/2407ce85c4fda7c1ec10ed6c89c9a4b7 to your computer and use it in GitHub Desktop.

Select an option

Save colstrom/2407ce85c4fda7c1ec10ed6c89c9a4b7 to your computer and use it in GitHub Desktop.
gistpkg-alias.fish: assigns alternate names to gistpkgs
function gistpkg-alias --argument canonical alias
empty "$canonical"
and return 100
empty "$alias"
and return 100
set --local canonical (sanitize-git-remote-url $canonical)
set --local alias (gistpkg-config root)/$alias
switch (exists $alias)
case true
echo "conflict: $alias exists"
return 101
case false
ln -s $canonical $alias
end
end
name = gistpkg-alias
author = Chris Olstrom
license = MIT
provides = fish/functions/gistpkg-alias
requires
command/ln
fish/builtin/and
fish/builtin/case
fish/builtin/echo
fish/builtin/end
fish/builtin/false
fish/builtin/function
fish/builtin/return
fish/builtin/set
fish/builtin/switch
fish/builtin/true
fish/functions/alias
fish/functions/empty
fish/functions/exists
fish/functions/sanitize-git-remote-url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment