Skip to content

Commit

Permalink
Only update Umbrel if migrations suceed
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Jun 18, 2023
1 parent 8d5b01b commit 3d7e398
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions server/update/index.js
Expand Up @@ -50,7 +50,22 @@ async function activatePowerButtonRecovery({updateRoot}) {
export default async function update({updateRoot, umbrelRoot}) {
console.log(`Running migrations from "${updateRoot}" on "${umbrelRoot}"`)

// We don't want to overwrite the Umbrel Home patches so we only update a whitelist of files
// Umbrel Home specific updates
if (await isUmbrelHome()) {
console.log('Running Umbrel Home specific migrations...')

await pRetry(() => updateNetworkManager(), {
retries: 3,
})

await pRetry(() => activatePowerButtonRecovery({updateRoot}), {
retries: 3,
})
}

// We don't want to overwrite the Umbrel Home patches so we only update a whitelist of files.
// We do the Umbrel install update last so if any of the above migrations fail, the user will
// still be on the old version of Umbrel and can try the update again.
const filesToUpdate = [
'scripts/start',
'scripts/stop',
Expand All @@ -68,17 +83,4 @@ export default async function update({updateRoot, umbrelRoot}) {

await fse.copy(updatePath, umbrelPath)
}

// Umbrel Home specific updates
if (await isUmbrelHome()) {
console.log('Running Umbrel Home specific migrations...')

await pRetry(() => updateNetworkManager(), {
retries: 3,
})

await pRetry(() => activatePowerButtonRecovery({updateRoot}), {
retries: 3,
})
}
}

0 comments on commit 3d7e398

Please sign in to comment.