Path root works
This commit is contained in:
parent
d06feb7303
commit
4deb359af8
|
@ -211,8 +211,8 @@
|
||||||
async function collect({chrome_port:port, mode} = {}) {
|
async function collect({chrome_port:port, mode} = {}) {
|
||||||
const {library_path} = args;
|
const {library_path} = args;
|
||||||
const exitHandlers = [];
|
const exitHandlers = [];
|
||||||
process.on('SIGUSR2', runHandlers);
|
|
||||||
process.on('beforeExit', runHandlers);
|
process.on('beforeExit', runHandlers);
|
||||||
|
process.on('SIGUSR2', code => runHandlers(code, 'SIGUSR2', {exit: true}));
|
||||||
process.on('exit', code => runHandlers(code, 'exit', {exit: true}));
|
process.on('exit', code => runHandlers(code, 'exit', {exit: true}));
|
||||||
State.connection = State.connection || await connect({port});
|
State.connection = State.connection || await connect({port});
|
||||||
State.onExit = {
|
State.onExit = {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import path from 'path';
|
||||||
import {fileURLToPath} from 'url';
|
import {fileURLToPath} from 'url';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
import root from './root.cjs';
|
||||||
|
|
||||||
const DEEB = false;
|
const DEEB = false;
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ export const SNIP_CONTEXT = 31;
|
||||||
export const NO_SANDBOX = (process.env.DEBUG_22120 && process.env.SET_22120_NO_SANDBOX) || false;
|
export const NO_SANDBOX = (process.env.DEBUG_22120 && process.env.SET_22120_NO_SANDBOX) || false;
|
||||||
|
|
||||||
//export const APP_ROOT = '.';
|
//export const APP_ROOT = '.';
|
||||||
export const APP_ROOT = path.dirname(process.argv[0]);
|
export const APP_ROOT = root.APP_ROOT;
|
||||||
//export const APP_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
//export const APP_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
export const sleep = ms => new Promise(res => setTimeout(res, ms));
|
export const sleep = ms => new Promise(res => setTimeout(res, ms));
|
||||||
|
|
|
@ -68,7 +68,12 @@ async function start({server_port}) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
upAt = new Date;
|
upAt = new Date;
|
||||||
say({server_up:{upAt,port}});
|
say({server_up:{upAt,port,
|
||||||
|
...(DEBUG.verboseSlow ? {
|
||||||
|
static_site_path: SITE_PATH,
|
||||||
|
app_root: APP_ROOT,
|
||||||
|
} : {})
|
||||||
|
}});
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
running = false;
|
running = false;
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
const path = require('path');
|
||||||
|
const url = require('url');
|
||||||
|
|
||||||
|
const file = __filename;
|
||||||
|
const dir = path.dirname(file);
|
||||||
|
|
||||||
|
console.log({file, dir});
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
APP_ROOT: dir,
|
||||||
|
dir,
|
||||||
|
file
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue