Mailcap and flake check (#26)

This commit is contained in:
Patrick Stevens
2023-10-04 15:25:52 +01:00
committed by GitHub
parent 8f956b631c
commit 3743aead94
4 changed files with 37 additions and 34 deletions

View File

@@ -3,17 +3,19 @@
outfile="$1/resharper-host/GlobalSettingsStorage.DotSettings"
if [ -e "$outfile" ]; then
existing=$(readlink "$outfile")
if [ $? -eq 1 ] ; then
if [ $? -eq 1 ]; then
echo "Backing up existing settings file $outfile"
mv "$outfile" "$outfile.bak"
ln -s "NIX-RIDER-CONFIG/GlobalSettingsStorage.DotSettings" "$outfile"
else
case "$existing" in
"/nix/store/"*)
ln -fs "NIX-RIDER-CONFIG/GlobalSettingsStorage.DotSettings" "$outfile" ;;
ln -fs "NIX-RIDER-CONFIG/GlobalSettingsStorage.DotSettings" "$outfile"
;;
*)
echo "Refusing to overwrite existing symlink to $existing" && \
exit 1 ;;
echo "Refusing to overwrite existing symlink to $existing" &&
exit 1
;;
esac
fi
else