Skip to content

Commit

Permalink
fix win related errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flancer64 committed Jun 10, 2023
1 parent 995d17a commit 4a36966
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bin/tequila.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
'use strict';
/** Main script to create and to run TeqFW backend application. */
// IMPORT
import {dirname, join} from 'node:path';
import Container from '@teqfw/di';
import {readFileSync} from "node:fs";
import {dirname, join} from 'node:path';
import {fileURLToPath} from 'node:url';
import {platform} from "node:process";
import {readFileSync} from 'node:fs';

// VARS
/* Resolve paths to main folders */
const url = new URL(import.meta.url);
const script = url.pathname;
const script = fileURLToPath(url);
const bin = dirname(script);
const root = join(bin, '..');

console.log(`URL: ${url}`);
console.log(`script: ${script}`);
console.log(`bin: ${bin}`);
console.log(`root: ${root}`);


// FUNCS
/**
* Create and setup DI container.
Expand All @@ -22,6 +30,7 @@ const root = join(bin, '..');
function initContainer(root) {
/** @type {TeqFw_Di_Shared_Container} */
const res = new Container();
res.getNsResolver().isWindows = (platform === 'win32');
const pathDi = join(root, 'node_modules/@teqfw/di/src');
const pathCore = join(root, 'node_modules/@teqfw/core/src');
res.addSourceMapping('TeqFw_Di', pathDi, true, 'mjs');
Expand Down

0 comments on commit 4a36966

Please sign in to comment.