mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-04 00:52:48 +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",
|
"name": "amacc1ng",
|
||||||
"version": "0.5.0",
|
"version": "0.6.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "amacc1ng",
|
"name": "amacc1ng",
|
||||||
"version": "0.5.0",
|
"version": "0.6.3",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "amacc1ng",
|
"name": "amacc1ng",
|
||||||
"version": "0.5.0",
|
"version": "0.6.3",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
||||||
"minify-icons": "ts-node-esm src/tools/minify-icon-font.ts",
|
"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 .",
|
"lint": "prettier --plugin-search-dir . --check .",
|
||||||
"format": "prettier --plugin-search-dir . --write .",
|
"format": "prettier --plugin-search-dir . --write .",
|
||||||
"typesafe-i18n": "typesafe-i18n"
|
"typesafe-i18n": "typesafe-i18n"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "app"
|
name = "app"
|
||||||
version = "0.5.0"
|
version = "0.6.3"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["Thea Schöbl <dev@theaninova.de>"]
|
authors = ["Thea Schöbl <dev@theaninova.de>"]
|
||||||
license = "AGPL-3"
|
license = "AGPL-3"
|
||||||
|
|||||||
@@ -6,21 +6,14 @@
|
|||||||
"devPath": "http://localhost:5173",
|
"devPath": "http://localhost:5173",
|
||||||
"distDir": "../build"
|
"distDir": "../build"
|
||||||
},
|
},
|
||||||
"package": {
|
"package": { "productName": "amacc1ng", "version": "0.6.3" },
|
||||||
"productName": "amacc1ng",
|
|
||||||
"version": "0.5.0"
|
|
||||||
},
|
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": { "all": false },
|
||||||
"all": false
|
|
||||||
},
|
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"category": "DeveloperTool",
|
"category": "DeveloperTool",
|
||||||
"copyright": "AGPL-3.0-or-later",
|
"copyright": "AGPL-3.0-or-later",
|
||||||
"deb": {
|
"deb": { "depends": [] },
|
||||||
"depends": []
|
|
||||||
},
|
|
||||||
"externalBin": [],
|
"externalBin": [],
|
||||||
"icon": [
|
"icon": [
|
||||||
"icons/32x32.png",
|
"icons/32x32.png",
|
||||||
@@ -47,9 +40,7 @@
|
|||||||
"timestampUrl": ""
|
"timestampUrl": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security": {
|
"security": { "csp": null },
|
||||||
"csp": null
|
|
||||||
},
|
|
||||||
"updater": {
|
"updater": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"endpoints": [
|
"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