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 = is-a-file | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/is-a-file | |
| requires | |
| fish/builtin/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 = is-a-directory | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/is-a-directory | |
| requires | |
| fish/builtin/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
| function exists -a target | |
| test -e "$target" | |
| status-to-bool $status | |
| 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 = list | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/list | |
| requires | |
| fish/builtin/case |
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 = show-source | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/show-source | |
| requires | |
| command/fish_indent |
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 = sanitize-git-remote-url | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/sanitize-git-remote-url | |
| requires | |
| fish/builtin/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
| function gistpkg-fetch --argument remote | |
| switch (count $argv) | |
| case 0 | |
| echo 'usage: gistpkg-fetch <remote>' | |
| return 100 | |
| case '*' | |
| set local (gistpkg-config root)/(sanitize-git-remote-url $remote) | |
| if directory-in-git $local >/dev/null | |
| set origin (git -C $local remote get-url --push origin) |
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-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 |
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 |
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 = upcase | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/upcase | |
| requires | |
| command/tr |