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
| #! /bin/sh | |
| # -*- shell-script -*- | |
| # The MIT License (MIT) | |
| # Copyright (c) 2017 Chris Olstrom <[email protected]> | |
| # Copyright (c) 2017 SUSE LLC | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights |
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
| #!/usr/bin/env ruby | |
| require 'set' | |
| data = Dir | |
| .glob('*') | |
| .reject { |file| file.end_with? '.rb' } | |
| .map { |os| [os, File.read(os)] } | |
| .map do |os, info| | |
| [ |
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 directory-in-git --argument dir | |
| git -C "$dir" rev-parse --is-inside-working-tree >/dev/null ^/dev/null | |
| 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 = tab | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/tab | |
| 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-manifest --argument file | |
| switch (count $argv) | |
| case 0 | |
| echo 'usage: gistpkg-manifest <file>' | |
| return 100 | |
| case '*' | |
| set name (basename -s .fish $file) | |
| printf "name = %s\n\n" $name |
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 = with-cwd-as | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/with-cwd-as | |
| requires | |
| fish/builtin/and |
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 = user-is-root | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/user-is-root | |
| requires | |
| command/id |
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 = sonar-lexer | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/sonar-lexer | |
| requires | |
| fish/builtin/and |
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-list | |
| set local (gistpkg-config root)/(gistpkg-config origin) | |
| if test (is-a-directory $local) = true | |
| find $local -type d -mindepth 1 -name .git -exec dirname '{}' \; | string replace --all --regex "^$local/" '' | |
| 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
| function gistpkg-avail --argument username | |
| switch (count $argv) | |
| case 0 | |
| echo 'usage: gistpkg-avail <username>' | |
| return 100 | |
| case '*' | |
| github-api /users/$username/gists | jq -r '.[] | select(.files | keys[] | test("^gistpkg.zpl$")) | [([.owner.login, .id] | join("/")), .description] | @tsv' | |
| end | |
| end |