Last active
December 9, 2016 19:09
-
-
Save colstrom/2407ce85c4fda7c1ec10ed6c89c9a4b7 to your computer and use it in GitHub Desktop.
gistpkg-alias.fish: assigns alternate names to gistpkgs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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