mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
20 lines
414 B
Fish
20 lines
414 B
Fish
|
function __fisher_file -a file -d "Read a fishfile and display its contents"
|
||
|
switch "$file"
|
||
|
case ""
|
||
|
set file $fisher_config/fishfile
|
||
|
|
||
|
case "-"
|
||
|
set file /dev/stdin
|
||
|
end
|
||
|
|
||
|
awk '
|
||
|
!/^ *(#.*)*$/ {
|
||
|
gsub("#.*", "")
|
||
|
|
||
|
if (/^ *package .+/) $1 = $2
|
||
|
|
||
|
if (!duplicates[$1]++) printf("%s\n", $1)
|
||
|
}
|
||
|
' $file
|
||
|
end
|