mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
33 lines
718 B
JavaScript
33 lines
718 B
JavaScript
/**
|
|
* This script is used to rename the binary with the platform specific postfix.
|
|
* When `tauri build` is ran, it looks for the binary name appended with the platform specific postfix.
|
|
*/
|
|
|
|
const execa = require('execa')
|
|
const fs = require('fs')
|
|
|
|
async function main() {
|
|
const rustTargetInfo = JSON.parse(
|
|
(
|
|
await execa(
|
|
'rustc',
|
|
['-Z', 'unstable-options', '--print', 'target-spec-json'],
|
|
{
|
|
env: {
|
|
RUSTC_BOOTSTRAP: 1
|
|
}
|
|
}
|
|
)
|
|
).stdout
|
|
)
|
|
const platformPostfix = rustTargetInfo['llvm-target']
|
|
fs.renameSync(
|
|
'src-tauri/binaries/app',
|
|
`src-tauri/binaries/app-${platformPostfix}`
|
|
)
|
|
}
|
|
|
|
main().catch((e) => {
|
|
throw e
|
|
})
|