Skip to content

Commit 50d8407

Browse files
committed
format code
1 parent 2099527 commit 50d8407

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

packages/builder-util-runtime/src/httpExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ Please double check that your authentication token is correct. Due to security r
354354
// Special case: allow http -> https redirect on same host with standard ports
355355
// This matches the behavior of Python requests library for backward compatibility
356356
// url.port returns an empty string if the port is omitted
357-
// or explicitly set to the default port for a given protocol.
357+
// or explicitly set to the default port for a given protocol.
358358
if (
359359
originalUrl.protocol === "http:" &&
360360
// This can be replaced with `!originalUrl.port`, but for the sake of clarity.

packages/builder-util-runtime/src/publishOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ export function githubTagPrefix(options: GithubOptions) {
156156
return options.tagNamePrefix
157157
}
158158
if (options.vPrefixedTagName ?? true) {
159-
return 'v'
159+
return "v"
160160
}
161-
return ''
161+
return ""
162162
}
163163

164164
/**

packages/electron-builder-squirrel-windows/src/SquirrelWindowsTarget.ts

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export default class SquirrelWindowsTarget extends Target {
161161
fs.copyFileSync(path.join(vendorDirectory, `7z-${resolvedArch}.dll`), path.join(vendorDirectory, "7z.dll"))
162162
}
163163

164-
private async createNuspecTemplateWithProjectUrl(additionalFiles: {src: string, target: string}[]) {
164+
private async createNuspecTemplateWithProjectUrl(additionalFiles: { src: string; target: string }[]) {
165165
const templatePath = path.resolve(__dirname, "..", "template.nuspectemplate")
166166
const projectUrl = await this.packager.appInfo.computePackageUrl()
167167

@@ -176,17 +176,11 @@ export default class SquirrelWindowsTarget extends Target {
176176
}
177177

178178
// Replace the additionalFiles loop with the actual files
179-
if(additionalFiles.length > 0) {
180-
const additionalFilesContent = additionalFiles.map(f => ` <file src="${f.src}" target="${f.target}" />`).join('\n')
181-
templateContent = templateContent.replace(
182-
'<% file src="additionalFiles.src" target="additionalFiles.target" / %>',
183-
additionalFilesContent
184-
)
185-
}else{
186-
templateContent = templateContent.replace(
187-
'<% file src="additionalFiles.src" target="additionalFiles.target" / %>',
188-
''
189-
)
179+
if (additionalFiles.length > 0) {
180+
const additionalFilesContent = additionalFiles.map(f => ` <file src="${f.src}" target="${f.target}" />`).join("\n")
181+
templateContent = templateContent.replace('<% file src="additionalFiles.src" target="additionalFiles.target" / %>', additionalFilesContent)
182+
} else {
183+
templateContent = templateContent.replace('<% file src="additionalFiles.src" target="additionalFiles.target" / %>', "")
190184
}
191185

192186
await fs.promises.writeFile(nuspecTemplate, templateContent)
@@ -207,17 +201,19 @@ export default class SquirrelWindowsTarget extends Target {
207201
const fileName = f.name
208202

209203
// Files explicitly included in template
210-
if (fileName.endsWith(".bin") ||
211-
fileName.endsWith(".dll") ||
212-
fileName.endsWith(".pak") ||
213-
fileName.endsWith(".exe.config") ||
214-
fileName.endsWith(".exe.sig") ||
215-
fileName.endsWith("_ExecutionStub.exe") ||
216-
fileName === "icudtl.dat" ||
217-
fileName === "Squirrel.exe" ||
218-
fileName === "LICENSE.electron.txt" ||
219-
fileName === "LICENSES.chromium.html" ||
220-
fileName === appExe) {
204+
if (
205+
fileName.endsWith(".bin") ||
206+
fileName.endsWith(".dll") ||
207+
fileName.endsWith(".pak") ||
208+
fileName.endsWith(".exe.config") ||
209+
fileName.endsWith(".exe.sig") ||
210+
fileName.endsWith("_ExecutionStub.exe") ||
211+
fileName === "icudtl.dat" ||
212+
fileName === "Squirrel.exe" ||
213+
fileName === "LICENSE.electron.txt" ||
214+
fileName === "LICENSES.chromium.html" ||
215+
fileName === appExe
216+
) {
221217
return false
222218
}
223219
return true
@@ -237,8 +233,6 @@ export default class SquirrelWindowsTarget extends Target {
237233
})
238234
}
239235

240-
241-
242236
async computeEffectiveDistOptions(appDirectory: string, outputDirectory: string, setupFile: string): Promise<SquirrelOptions> {
243237
const packager = this.packager
244238
let iconUrl = this.options.iconUrl
@@ -253,7 +247,6 @@ export default class SquirrelWindowsTarget extends Target {
253247
}
254248
}
255249

256-
257250
const additionalFiles = await this.getAdditionalFiles(appDirectory, this.exeName)
258251
checkConflictingOptions(this.options)
259252
const appInfo = packager.appInfo

packages/electron-builder/src/builder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ export function configureBuildCommand(yargs: yargs.Argv): yargs.Argv {
287287
alias: ["c"],
288288
group: buildGroup,
289289
description:
290-
"The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see " + chalk.underline("https://www.electron.build/configuration"),
290+
"The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see " +
291+
chalk.underline("https://www.electron.build/configuration"),
291292
})
292293
.group(["help", "version"], "Other:")
293294
.example("electron-builder -mwl", "build for macOS, Windows and Linux")

0 commit comments

Comments
 (0)