feat: publish HoloLake model-native living system source
This commit is contained in:
parent
6ad10edde1
commit
c395dd3a99
2467 changed files with 615073 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
const SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/
|
||||
|
||||
export async function resolveInternalReleaseVersion(configPath, explicitVersion = '') {
|
||||
const config = JSON.parse(await readFile(configPath, 'utf8'))
|
||||
const configuredVersion = String(config.version ?? '').trim()
|
||||
|
||||
if (!SEMVER.test(configuredVersion)) {
|
||||
throw new Error(`tauri.conf.json must contain a valid semantic version; received: ${configuredVersion || '<empty>'}`)
|
||||
}
|
||||
|
||||
const requestedVersion = explicitVersion.trim()
|
||||
if (requestedVersion && requestedVersion !== configuredVersion) {
|
||||
throw new Error(`Requested version ${requestedVersion} does not match configured version ${configuredVersion}`)
|
||||
}
|
||||
|
||||
return configuredVersion
|
||||
}
|
||||
|
||||
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
||||
const configPath = process.argv[2]
|
||||
if (!configPath) {
|
||||
console.error('Usage: node scripts/internal-release-version.mjs <tauri.conf.json> [expected-version]')
|
||||
process.exit(2)
|
||||
}
|
||||
|
||||
try {
|
||||
console.log(await resolveInternalReleaseVersion(configPath, process.argv[3] ?? ''))
|
||||
} catch (error) {
|
||||
console.error(error instanceof Error ? error.message : String(error))
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue