desktop-exports: Improve command detection algorithm (#129)
desktop-exports: Improve command detection algorithm (#129)

Previously the script relies on the behavior of `test`(builtin) when 1 arguments is given(returns 0 when argument string not null, 1 elsewise), which is unnecessary and error-prone when the command path contains spaces.  This patch replaces them with straight return value checking of `command`(also builtin).

Maybe-related-to: desktop-launch: line 199: [: too many arguments · Issue #114 · ubuntu/snapcraft-desktop-helpers <https://github.com/ubuntu/snapcraft-desktop-helpers/issues/114>
Signed-off-by: 林博仁(Buo-ren Lin) <e1a755dad2798d70422023dceee1245c3d6b4517@gmail.com>
ubuntu/snapcraft-desktop-helpers