mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-09 11:32:49 +00:00
update version hook
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "amacc1ng",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "amacc1ng",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.3",
|
||||
"hasInstallScript": true,
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "amacc1ng",
|
||||
"version": "0.5.0",
|
||||
"version": "0.6.3",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"private": true,
|
||||
"repository": {
|
||||
@@ -24,6 +24,7 @@
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
||||
"minify-icons": "ts-node-esm src/tools/minify-icon-font.ts",
|
||||
"version": "ts-node-esm src/tools/version.ts && git add src-tauri/Cargo.toml && git add src-tauri/tauri.conf.json",
|
||||
"lint": "prettier --plugin-search-dir . --check .",
|
||||
"format": "prettier --plugin-search-dir . --write .",
|
||||
"typesafe-i18n": "typesafe-i18n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.5.0"
|
||||
version = "0.6.3"
|
||||
description = "A Tauri App"
|
||||
authors = ["Thea Schöbl <dev@theaninova.de>"]
|
||||
license = "AGPL-3"
|
||||
|
||||
@@ -6,21 +6,14 @@
|
||||
"devPath": "http://localhost:5173",
|
||||
"distDir": "../build"
|
||||
},
|
||||
"package": {
|
||||
"productName": "amacc1ng",
|
||||
"version": "0.5.0"
|
||||
},
|
||||
"package": { "productName": "amacc1ng", "version": "0.6.3" },
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": false
|
||||
},
|
||||
"allowlist": { "all": false },
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "AGPL-3.0-or-later",
|
||||
"deb": {
|
||||
"depends": []
|
||||
},
|
||||
"deb": { "depends": [] },
|
||||
"externalBin": [],
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
@@ -47,9 +40,7 @@
|
||||
"timestampUrl": ""
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
"csp": null
|
||||
},
|
||||
"security": { "csp": null },
|
||||
"updater": {
|
||||
"active": true,
|
||||
"endpoints": [
|
||||
|
||||
20
src/tools/version.ts
Normal file
20
src/tools/version.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import {readFile, writeFile} from "fs/promises"
|
||||
import {fileURLToPath} from "url"
|
||||
import * as path from "path"
|
||||
import {format} from "prettier"
|
||||
|
||||
const projectDir = path.resolve(fileURLToPath(import.meta.url), "..", "..", "..")
|
||||
|
||||
const {version} = JSON.parse(await readFile(path.join(projectDir, "package.json"), "utf8"))
|
||||
|
||||
const tauriConfigPath = path.join(projectDir, "src-tauri", "tauri.conf.json")
|
||||
|
||||
const tauriConfig = JSON.parse(await readFile(tauriConfigPath, "utf8"))
|
||||
tauriConfig.package.version = version
|
||||
await writeFile(tauriConfigPath, await format(JSON.stringify(tauriConfig), {parser: "json"}))
|
||||
|
||||
const cargoTomlPath = path.join(projectDir, "src-tauri", "Cargo.toml")
|
||||
|
||||
const cargoToml = await readFile(cargoTomlPath, "utf8")
|
||||
const modified = cargoToml.replace(/^\s*version\s*=\s*"\d\.\d.\d"\s*$/m, `version = "${version}"`)
|
||||
await writeFile(cargoTomlPath, modified)
|
||||
Reference in New Issue
Block a user