hashicorp / boundary-ui

Monorepo for Boundary UIs and addons.
http://boundary-ui.vercel.app
Other
87 stars 28 forks source link

appupdater cli check #2504

Open calcaide opened 3 days ago

calcaide commented 3 days ago

Description

ICU-15109

Add check on the appUpdater to skip it if the Desktop client is NOT using the built in CLI.

IMPORTANT The first approach I tried was to use node fs.lstatSync. The issue I encounter is that the lstat object returned, in POSIX systems, the key file always false value. This happens because on POSIX system, the binary name we return is boundary without file extension, therefore the lstat object mark it as directory, whatever we were passing boundary or electron-app/cli/boundary.

Decided to rely on parsing the path. If the parsed object returns values for the keys dir and root, means it is indeed the CLI built in the desktop client.

Happy to discuss other approaches.

How to Test

For Mac:

Use the built in CLI:

Use system CLI:

For Windows:

Notice in windows, we have the appUpdater disabled, so it will not be possible to test without code modifications.

Code modifications:

Test procedure:

vercel[bot] commented 3 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boundary-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2024 7:40pm
boundary-ui-desktop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2024 7:40pm