@@ -3,7 +3,7 @@ import type { Buffer } from 'node:buffer'
33import fs from 'node:fs/promises'
44import path from 'node:path'
55
6- import type { DownloadingInfo , UpdateInfoWithURL , UpdateJSONWithURL } from './types'
6+ import type { DownloadingInfo , UpdateInfoWithURL , VersionJSON } from './types'
77
88import { isUpdateJSON } from '../utils'
99import { BaseProvider } from './base'
@@ -13,17 +13,12 @@ export interface LocalDevProviderOptions {
1313 * Base directory for update files
1414 */
1515 baseDir : string
16- /**
17- * App name (used for constructing file paths)
18- */
19- appName ?: string
2016}
2117
2218/**
2319 * Update Provider for local development
24- * - check update from local file system
25- * - download update json and get version and download url
26- * - download update asar from local file system
20+ * - download update json from `{baseDir}/{versionPath}`
21+ * - download update asar from `{baseDir}/{name}-{version}.asar.gz`
2722 *
2823 * This provider is useful for testing updates during development without
2924 * needing to deploy to a remote server.
@@ -43,14 +38,15 @@ export class LocalDevProvider extends BaseProvider {
4338 name : string ,
4439 versionPath : string ,
4540 signal : AbortSignal ,
46- ) : Promise < UpdateJSONWithURL > {
41+ ) : Promise < VersionJSON > {
4742 signal . throwIfAborted ( )
4843
49- const { beta, version, ...info } = await this . readJSON ( versionPath )
44+ const { beta, version, ...info } = await this . readJSON (
45+ path . join ( this . options . baseDir , versionPath ) ,
46+ )
5047
51- const getAppName = this . options . appName || name
5248 const getURL = ( ver : string ) : string =>
53- path . join ( this . options . baseDir , `${ getAppName } -${ ver } .asar.gz` )
49+ path . join ( this . options . baseDir , `${ name } -${ ver } .asar.gz` )
5450
5551 return {
5652 ...info ,
0 commit comments