mirror of
https://github.com/desktop/desktop
synced 2024-09-13 21:31:32 +00:00
Merge pull request #12872 from desktop/why-so-noisy-friend
Tidy up log messages around scanning for installed editors
This commit is contained in:
commit
6d974afa44
|
@ -131,15 +131,28 @@ async function findApplication(
|
|||
): Promise<string | null> {
|
||||
for (const identifier of editor.bundleIdentifiers) {
|
||||
try {
|
||||
const installPath = await appPath(identifier)
|
||||
const exists = await pathExists(installPath)
|
||||
if (exists) {
|
||||
// app-path not finding the app isn't an error, it just means the
|
||||
// bundle isn't registered on the machine.
|
||||
// https://github.com/sindresorhus/app-path/blob/0e776d4e132676976b4a64e09b5e5a4c6e99fcba/index.js#L7-L13
|
||||
const installPath = await appPath(identifier).catch(e =>
|
||||
e.message === "Couldn't find the app"
|
||||
? Promise.resolve(null)
|
||||
: Promise.reject(e)
|
||||
)
|
||||
|
||||
if (installPath === null) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (await pathExists(installPath)) {
|
||||
return installPath
|
||||
}
|
||||
|
||||
log.debug(`App installation for ${editor} not found at '${installPath}'`)
|
||||
log.debug(
|
||||
`App installation for ${editor.name} not found at '${installPath}'`
|
||||
)
|
||||
} catch (error) {
|
||||
log.debug(`Unable to locate ${editor} installation`, error)
|
||||
log.debug(`Unable to locate ${editor.name} installation`, error)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue