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`)
|
@Command.String(`--name`)
|
||||||
name!: string
|
name!: string
|
||||||
|
|
||||||
@Command.String(`--platform`)
|
@Command.Boolean(`--platform`)
|
||||||
appendPlatformToFilename!: string
|
appendPlatformToFilename!: boolean
|
||||||
|
|
||||||
@Command.Boolean(`--release`)
|
@Command.Boolean(`--release`)
|
||||||
isRelease = false
|
isRelease = false
|
||||||
|
@ -82,10 +82,14 @@ export class BuildCommand extends Command {
|
||||||
|
|
||||||
const targetDir = this.isRelease ? 'release' : 'debug'
|
const targetDir = this.isRelease ? 'release' : 'debug'
|
||||||
|
|
||||||
const platformName = this.isMusl
|
if (this.isMusl && !this.appendPlatformToFilename) {
|
||||||
? '.musl'
|
throw new TypeError(`Musl flag must be used with platform flag`)
|
||||||
: this.appendPlatformToFilename
|
}
|
||||||
? `.${platform}`
|
|
||||||
|
const platformName = this.appendPlatformToFilename
|
||||||
|
? !this.isMusl
|
||||||
|
? `.${platform}`
|
||||||
|
: `.${platform}-musl`
|
||||||
: ''
|
: ''
|
||||||
|
|
||||||
let distModulePath =
|
let distModulePath =
|
||||||
|
|
Loading…
Add table
Reference in a new issue