mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Ignore line endings when comparing config file against default (#3645)
This commit is contained in:
parent
efeedd0a9d
commit
6a05b7307c
1 changed files with 14 additions and 10 deletions
|
|
@ -55,16 +55,20 @@ const migrateHyper2Config = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasNewConfigBeenTouched = existsNew && readFileSync(cfgPath, 'utf8') !== readFileSync(defaultCfg, 'utf8');
|
if (existsNew) {
|
||||||
if (hasNewConfigBeenTouched) {
|
const cfg1 = readFileSync(defaultCfg, 'utf8').replace(/\r|\n/g, '');
|
||||||
// Assume the user has migrated manually but rename old config to .backup so
|
const cfg2 = readFileSync(cfgPath, 'utf8').replace(/\r|\n/g, '');
|
||||||
// we don't keep trying to migrate on every launch
|
const hasNewConfigBeenTouched = cfg1 !== cfg2;
|
||||||
const backupPath = saveAsBackup(legacyCfgPath);
|
if (hasNewConfigBeenTouched) {
|
||||||
notify(
|
// Assume the user has migrated manually but rename old config to .backup so
|
||||||
'Hyper 3',
|
// we don't keep trying to migrate on every launch
|
||||||
`Settings location has changed to ${cfgPath}.\nWe've backed up your old Hyper config to ${backupPath}`
|
const backupPath = saveAsBackup(legacyCfgPath);
|
||||||
);
|
notify(
|
||||||
return;
|
'Hyper 3',
|
||||||
|
`Settings location has changed to ${cfgPath}.\nWe've backed up your old Hyper config to ${backupPath}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate
|
// Migrate
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue