SDK catalog / Self Update

Self Update

alpha 0.3.0-alpha.2

Preview documentation for @wf/self-update@0.3.0-alpha.2. Existing legacy downloads may use a different API; this page does not announce a new release.

Join the alpha Sign in with Google, then add your name. We review alpha access requests.

import { cp } from 'node:fs/promises'
import { createSelfUpdater } from '@wf/self-update'

// The app supplies its source, built files, and an entry that exits after --self-test.
const updater = createSelfUpdater(process.argv[2] ?? './self-update.yaml', {
  runningCommit: process.env.APP_COMMIT ?? '',
  build: directory => cp('./dist', directory, { recursive: true }),
})
try {
  console.log(process.argv.includes('--apply') ? await updater.update() : await updater.check())
} finally {
  await updater.dispose()
}