mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 12:55:14 +03:00
Fix rev (#3652)
* Fix rev * Remove COMMITHASH * Use manifest for Android too * Fix copy pasta
This commit is contained in:
parent
66bc1898ca
commit
ec0ceb6911
2 changed files with 4 additions and 3 deletions
|
@ -50,7 +50,7 @@ function useGlobalNodeFunctions() {
|
|||
}
|
||||
|
||||
function readConfiguratorVersionMetadata() {
|
||||
if (GUI.isNWJS()) {
|
||||
if (GUI.isNWJS() || GUI.isCordova()) {
|
||||
const manifest = chrome.runtime.getManifest();
|
||||
CONFIGURATOR.productName = manifest.productName;
|
||||
CONFIGURATOR.version = manifest.version;
|
||||
|
|
|
@ -5,8 +5,9 @@ import path from "node:path";
|
|||
import { readFileSync } from "node:fs";
|
||||
import copy from "rollup-plugin-copy";
|
||||
import pkg from './package.json';
|
||||
import * as child from 'child_process';
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const commitHash = child.execSync('git rev-parse --short HEAD').toString();
|
||||
|
||||
function serveFileFromDirectory(directory) {
|
||||
return (req, res, next) => {
|
||||
|
@ -52,7 +53,7 @@ export default defineConfig({
|
|||
define: {
|
||||
'__APP_VERSION__': JSON.stringify(pkg.version),
|
||||
'__APP_PRODUCTNAME__': JSON.stringify(pkg.productName),
|
||||
'__APP_REVISION__': JSON.stringify(childProcess.execSync("git rev-parse --short HEAD").toString().trim()),
|
||||
'__APP_REVISION__': JSON.stringify(commitHash),
|
||||
},
|
||||
test: {
|
||||
// NOTE: this is a replacement location for karma tests.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue