refactor(npm): musl target filename
This commit is contained in:
parent
a757913185
commit
56f3aca880
1 changed files with 10 additions and 6 deletions
16
src/build.ts
16
src/build.ts
|
@ -17,8 +17,8 @@ export class BuildCommand extends Command {
|
|||
@Command.String(`--name`)
|
||||
name!: string
|
||||
|
||||
@Command.String(`--platform`)
|
||||
appendPlatformToFilename!: string
|
||||
@Command.Boolean(`--platform`)
|
||||
appendPlatformToFilename!: boolean
|
||||
|
||||
@Command.Boolean(`--release`)
|
||||
isRelease = false
|
||||
|
@ -82,10 +82,14 @@ export class BuildCommand extends Command {
|
|||
|
||||
const targetDir = this.isRelease ? 'release' : 'debug'
|
||||
|
||||
const platformName = this.isMusl
|
||||
? '.musl'
|
||||
: this.appendPlatformToFilename
|
||||
? `.${platform}`
|
||||
if (this.isMusl && !this.appendPlatformToFilename) {
|
||||
throw new TypeError(`Musl flag must be used with platform flag`)
|
||||
}
|
||||
|
||||
const platformName = this.appendPlatformToFilename
|
||||
? !this.isMusl
|
||||
? `.${platform}`
|
||||
: `.${platform}-musl`
|
||||
: ''
|
||||
|
||||
let distModulePath =
|
||||
|
|
Loading…
Reference in a new issue