'/.dockerenv' did not exist in container...
This commit is contained in:
parent
6560afa2b5
commit
9261be690c
1 changed files with 3 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
// check if running the latest version
|
// check if running the latest version
|
||||||
|
|
||||||
import {log} from 'console';
|
import {log} from 'console';
|
||||||
import { existsSync, readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
|
|
||||||
const execp = (cmd) => new Promise((resolve, reject) => {
|
const execp = (cmd) => new Promise((resolve, reject) => {
|
||||||
|
|
@ -22,7 +22,8 @@ const execp = (cmd) => new Promise((resolve, reject) => {
|
||||||
const git_main = () => readFileSync('.git/refs/heads/main').toString().trim();
|
const git_main = () => readFileSync('.git/refs/heads/main').toString().trim();
|
||||||
|
|
||||||
let sha, date;
|
let sha, date;
|
||||||
if (existsSync('/.dockerenv')) {
|
// if (existsSync('/.dockerenv')) { // did not work
|
||||||
|
if (process.env.NOVNC_PORT) {
|
||||||
log('Running inside Docker.');
|
log('Running inside Docker.');
|
||||||
['COMMIT', 'BRANCH', 'NOW'].forEach(v => log(` ${v}:`, process.env[v]));
|
['COMMIT', 'BRANCH', 'NOW'].forEach(v => log(` ${v}:`, process.env[v]));
|
||||||
sha = process.env.COMMIT;
|
sha = process.env.COMMIT;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue