Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use buildVersion not buildNumber for fpm --iteration flag #7075

Merged
merged 5 commits into from Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/app-builder-lib/src/targets/fpm.ts
Expand Up @@ -180,10 +180,17 @@ export default class FpmTarget extends Target {
}
}

use(packager.info.metadata.license, it => args.push("--license", it!))
use(appInfo.buildNumber, it => args.push("--iteration", it!))

use(options.fpm, it => args.push(...(it as any)))
use(packager.info.metadata.license, it => args.push("--license", it))
use(appInfo.buildVersion, it =>
args.push(
"--iteration",
// dashes are not supported for iteration in older versions of fpm
// https://github.com/jordansissel/fpm/issues/1833
it.split("-").join("_")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to it.replaceAll('-', '_')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaceAll isn't supported in Node 14.

)
)

use(options.fpm, it => args.push(...it))

args.push(`${appOutDir}/=${installPrefix}/${appInfo.sanitizedProductName}`)
for (const icon of await this.helper.icons) {
Expand Down
3 changes: 2 additions & 1 deletion packages/builder-util/src/util.ts
Expand Up @@ -265,7 +265,8 @@ export class ExecError extends Error {
}
}

export function use<T, R>(value: T | null, task: (it: T) => R): R | null {
type Nullish = null | undefined
export function use<T, R>(value: T | Nullish, task: (value: T) => R): R | null {
return value == null ? null : task(value)
}

Expand Down