mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-22 12:30:45 +08:00
[split] Move gi plugin to oh-my-fish/plugin-gi
https://github.com/oh-my-fish/plugin-gi
This commit is contained in:
parent
00323c3948
commit
b2e64fd3fc
|
@ -1,23 +0,0 @@
|
||||||
gitignore (gi) plugin
|
|
||||||
=====================
|
|
||||||
|
|
||||||
This plugin provides a simple command line interface to gitignore.io - a
|
|
||||||
website that generates .gitignore files based on your project requirements.
|
|
||||||
|
|
||||||
## Completions
|
|
||||||
|
|
||||||
The first step is to download the latest language list from gitignore.io so
|
|
||||||
that the fish completions can be updated. Run `gi update-completions` to
|
|
||||||
download the completions, they will be stored in
|
|
||||||
`~/.config/fish/completions/gi.fish`
|
|
||||||
|
|
||||||
You should repeat this occasionally to keep up to date.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Type `gi` followed by TAB to view the list of languages available. To generate
|
|
||||||
a .gitignore file, specify the list of languages you are interested in and pipe
|
|
||||||
the output into the destination file. Example for a go-lang project:
|
|
||||||
|
|
||||||
gi go tags vagrant > .gitignore
|
|
||||||
git add .gitignore
|
|
|
@ -1,21 +0,0 @@
|
||||||
function _update_gi_completions -d "Update completions for gitignore.io"
|
|
||||||
set compl_dir ~/.config/fish/completions
|
|
||||||
set compl_file "$compl_dir/gi.fish"
|
|
||||||
|
|
||||||
# Download list of ignore types
|
|
||||||
set -l gi_list (gi list | tr ',' ' ')
|
|
||||||
if test -z $gi_list
|
|
||||||
echo "No result returned from gitignore.io" >&2
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
# Backup existing completions
|
|
||||||
if test -e $compl_file
|
|
||||||
mv -f $compl_file {$compl_file}.bak
|
|
||||||
else if not test -d $compl_dir
|
|
||||||
mkdir -p $compl_dir
|
|
||||||
end
|
|
||||||
|
|
||||||
# Output new completions
|
|
||||||
echo complete -c gi -a \"update-completions $gi_list\" >$compl_file
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
function gi -d "gitignore.io cli for fish"
|
|
||||||
if test $argv[1] = 'update-completions'
|
|
||||||
_update_gi_completions
|
|
||||||
return $status
|
|
||||||
end
|
|
||||||
|
|
||||||
set -l params (echo $argv|tr ' ' ',')
|
|
||||||
curl -s https://www.gitignore.io/api/$params
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user