workaround: pkg does not exist on type Process

This commit is contained in:
RealBeepMcJeep
2023-08-30 08:41:38 -07:00
parent 11cef1b234
commit 94c6b453c0

View File

@ -53,8 +53,8 @@ const cliArguments = yargs(hideBin(process.argv))
// change all relative paths // change all relative paths
const path = require('path'); const path = require('path');
const directory = process.pkg ? path.dirname(process.execPath) : __dirname; const directory = process['pkg'] ? path.dirname(process.execPath) : __dirname;
console.log(process.pkg ? 'Running from binary' : 'Running from source'); console.log(process['pkg'] ? 'Running from binary' : 'Running from source');
process.chdir(directory); process.chdir(directory);
const express = require('express'); const express = require('express');
@ -837,7 +837,7 @@ function getVersion() {
try { try {
const pkgJson = require('./package.json'); const pkgJson = require('./package.json');
pkgVersion = pkgJson.version; pkgVersion = pkgJson.version;
if (!process.pkg && commandExistsSync('git')) { if (!process['pkg'] && commandExistsSync('git')) {
gitRevision = require('child_process') gitRevision = require('child_process')
.execSync('git rev-parse --short HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] }) .execSync('git rev-parse --short HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] })
.toString().trim(); .toString().trim();