mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 16:26:28 +00:00
Nicco
d7e5a34b14
* move to packages * update deps * update deps * actions maintenance * don't use blob * cli * fix default import * use synthetic default imports * remove comment * cli packaging * node 18 guard * packages * build system * testing * test pipeline * pipelines * changelog * version bump * update locales * update deps * update deps * update dependecies
21 lines
813 B
JavaScript
Executable File
21 lines
813 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import shelljs from 'shelljs'
|
|
import { execSync } from 'node:child_process'
|
|
|
|
const VERSION = process.argv[2]
|
|
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
|
const semver =
|
|
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm
|
|
if (!semver.test(VERSION)) {
|
|
console.error('Invalid version number')
|
|
process.exit(1)
|
|
}
|
|
|
|
// CLI
|
|
shelljs.sed('-i', /"version": ".*"/, `"version": "${process.argv[2]}"`, './packages/cli/package.json')
|
|
|
|
// Backend
|
|
shelljs.sed('-i', /^version = ".*"$/m, `version = "${process.argv[2]}"`, './packages/backend/Cargo.toml')
|
|
execSync('cargo check -p cryptgeon', { cwd: './packages/backend' })
|