Re: [PATCH 1/3] mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 5, 2020, 22:14 UTC
- Message-ID
- <xmqqlfisn3jk.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAPig+cR_04fL85nH1tJnbWYbwk3Bn5fRqzr2JReB2xXu9iUGAQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 10 quoted lines
> Rather than looping and mucking with IFS, even easier would be:
>
> is_desktop () {
> case ":$XDG_CURRENT_DESKTOP:" in
> *:$1:*) return 0 ;;
> *) return 1 ;;
> esac
> }
>
> But perhaps that's too magical for people?Nah, that is exactly how 'case' in shell is supposed to be used.
Thanks.