mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
Improve detection of selected editor on Windows (#3242)
Improves upon previous work completed in #2631: - Add additional system default check: `JSFile` - Relax restriction on `.exe` file extension as it is an invalid assumption: Closes #3223
This commit is contained in:
parent
932384f0b4
commit
cf35fe98cd
1 changed files with 4 additions and 4 deletions
|
|
@ -25,8 +25,8 @@ if (process.platform === 'win32') {
|
|||
});
|
||||
|
||||
// Find UserChoice key
|
||||
const userChoice = keys.filter(k => k.key.endsWith('UserChoice'));
|
||||
return userChoice[0];
|
||||
const userChoice = keys.find(k => k.key.endsWith('UserChoice'));
|
||||
return userChoice;
|
||||
};
|
||||
|
||||
const hasDefaultSet = async () => {
|
||||
|
|
@ -44,8 +44,8 @@ if (process.platform === 'win32') {
|
|||
});
|
||||
|
||||
// Look for default program
|
||||
const hasDefaultProgramConfigured = values.some(
|
||||
value => value && typeof value === 'string' && value.endsWith('.exe') && !value.includes('WScript.exe')
|
||||
const hasDefaultProgramConfigured = values.every(
|
||||
value => value && typeof value === 'string' && !value.includes('WScript.exe') && !value.includes('JSFile')
|
||||
);
|
||||
|
||||
return hasDefaultProgramConfigured;
|
||||
|
|
|
|||
Loading…
Reference in a new issue