environment: fixup ESM compatibility of __dirname
`import.meta.dirname` is introduced in node 20, currently not available for node 16.
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
export const SYSROOT_PREFIX = "/usr/sw/standard-830-6b-test";
|
export const SYSROOT_PREFIX = "/usr/sw/standard-830-6b-test";
|
||||||
export const projectRoot = path.join(import.meta.dirname, "..", "..");
|
export const projectRoot = path.join(__dirname, "..", "..");
|
||||||
export const local = path.resolve(projectRoot, "local");
|
export const local = path.resolve(projectRoot, "local");
|
||||||
|
|
||||||
export interface HaveSPEC2017 {
|
export interface HaveSPEC2017 {
|
||||||
|
|||||||
Reference in New Issue
Block a user