Skip to content

Commit

Permalink
Fix rev (betaflight#3652)
Browse files Browse the repository at this point in the history
* Fix rev

* Remove COMMITHASH

* Use manifest for Android too

* Fix copy pasta
  • Loading branch information
haslinghuis authored Dec 1, 2023
1 parent 66bc189 commit ec0ceb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ec0ceb6

Please sign in to comment.