Skip to content

Commit

Permalink
chore: update test snapshot and improve file path logging (#8463)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta authored Sep 11, 2024
1 parent a5b2f48 commit c081df8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-cobras-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

chore: improving file path logging to be relative paths when within process.cwd()
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/electron/electronWin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ export async function addWinAsarIntegrity(executablePath: string, asarIntegrity:
resource.outputResource(executable)

await writeFile(executablePath, Buffer.from(executable.generate()))
log.info({ executablePath }, "updating asar integrity executable resource")
log.info({ executablePath: log.filePath(executablePath) }, "updating asar integrity executable resource")
}
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/electron/injectFFMPEG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const copyFFMPEG = (targetPath: string, platform: ElectronPlatformName) => (sour

const libPath = path.resolve(sourcePath, fileName)
const libTargetPath = path.resolve(targetPath, fileName)
log.info({ lib: libPath, target: libTargetPath }, "copying non-proprietary FFMPEG")
log.info({ lib: log.filePath(libPath), target: log.filePath(libTargetPath) }, "copying non-proprietary FFMPEG")

// If the source doesn't exist we have a problem
if (!fs.existsSync(libPath)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class PublishManager implements PublishContext {
if (publisher == null) {
log.debug(
{
file: event.file,
file: log.filePath(event.file),
reason: "publisher is null",
publishConfig: safeStringifyJson(publishConfig),
},
Expand All @@ -163,7 +163,7 @@ export class PublishManager implements PublishContext {

const providerName = publisher.providerName
if (this.publishOptions.publish === "onTagOrDraft" && getCiTag() == null && providerName !== "bitbucket" && providerName !== "github") {
log.info({ file: event.file, reason: "current build is not for a git tag", publishPolicy: "onTagOrDraft" }, `not published to ${providerName}`)
log.info({ file: log.filePath(event.file), reason: "current build is not for a git tag", publishPolicy: "onTagOrDraft" }, `not published to ${providerName}`)
return
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/FpmTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class FpmTarget extends Target {
if (publishConfig != null) {
const linuxDistType = this.packager.packagerOptions.prepackaged || path.join(this.outDir, `linux${getArchSuffix(arch)}-unpacked`)
const resourceDir = packager.getResourcesDir(linuxDistType)
log.info({ resourceDir }, `adding autoupdate files for: ${target}. (Beta feature)`)
log.info({ resourceDir: log.filePath(resourceDir) }, `adding autoupdate files for: ${target}. (Beta feature)`)
await outputFile(path.join(resourceDir, "app-update.yml"), serializeToYaml(publishConfig))
// Extra file needed for auto-updater to detect installation method
await outputFile(path.join(resourceDir, "package-type"), target)
Expand Down
3 changes: 3 additions & 0 deletions test/snapshots/BuildTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,9 @@ Object {
"LICENSE": Object {
"size": "<size>",
},
"SECURITY.md": Object {
"size": "<size>",
},
"index.js": Object {
"size": "<size>",
},
Expand Down

0 comments on commit c081df8

Please sign in to comment.