You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
599 B

import pkg from './package.json'
import { execSync } from 'child_process'
export default {
define: {
APP_TITLE: pkg.name,
APP_VERSION: buildVersion(),
}
}
// FUNCTIONS
//----------
function buildVersion(): string {
const version = pkg.version
if (!isGitCommand()) {
return version
}
const dirty = Number(execSync("git status -s | wc -l").toString())
return dirty > 0 ? `${version}${dirty}` : version
}
function isGitCommand() {
try {
execSync("command -v git")
return true
} catch (e) {
return false
}
}