Add function for fish to create library symlinks

This commit is contained in:
Erwin Boskma 2022-09-04 13:25:28 +02:00
parent 2dfc62be11
commit 16e05c824d
Signed by: erwin
GPG key ID: 270B20D17394F7E5

View file

@ -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
'';
};
}