Add function for fish to create library symlinks
This commit is contained in:
parent
2dfc62be11
commit
16e05c824d
1 changed files with 23 additions and 0 deletions
|
@ -40,4 +40,27 @@
|
|||
'';
|
||||
description = "Use clang-format to format all changed and added files";
|
||||
};
|
||||
|
||||
linklib = {
|
||||
body = ''
|
||||
function linklib --argument lib
|
||||
set libcomponents (string split "." "$lib")
|
||||
set libname $libcomponents[1].$libcomponents[2]
|
||||
set libmajor $libname.$libcomponents[3]
|
||||
|
||||
if test -f $libname -o -L $libname
|
||||
echo "$libname already exists"
|
||||
return 1
|
||||
end
|
||||
|
||||
if test -f $libmajor -o -L $libmajor
|
||||
echo "$libmajor already exists"
|
||||
return 2
|
||||
end
|
||||
|
||||
ln -s $lib $libmajor
|
||||
ln -s $libmajor $libname
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue