Skip to content

Commit

Permalink
fix: import map
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed Jan 8, 2023
1 parent 4ecebc1 commit f64002a
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions reactive_home/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,29 @@ async function executeScripts(abort: AbortSignal) {

console.info("Load script", path.path);

const args = [
"deno",
"run",
`--lock=${join(flags.root, "deno.lock")}`,
"--allow-read",
`--allow-env=NODE_ENV,HASS_LONG_LIVED_TOKEN,HASS_URL`,
"--allow-net",
"--unstable", // npm import
];

const importMapPath = join(flags.root, "import_map.json");

try {
const fileInfo = Deno.statSync(importMapPath);

if (fileInfo && fileInfo.isFile) {
args.push(`--import-map=${importMapPath}`);
}
// deno-lint-ignore no-empty
} catch {}

const process = Deno.run({
cmd: [
"deno",
"run",
`--lock=${join(flags.root, "deno.lock")}`,
"--allow-read",
`--allow-env=NODE_ENV,HASS_LONG_LIVED_TOKEN,HASS_URL`,
"--allow-net",
"--unstable", // npm import
path.path,
],
cmd: [...args, path.path],
});

abort.addEventListener("abort", () => {
Expand Down

0 comments on commit f64002a

Please sign in to comment.