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
569 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 = execSync("git status -s | wc -l").toString()
return `${version}${dirty}`
}
function isGitCommand() {
try {
execSync("command -v git")
return true
} catch (e) {
return false
}
}