-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b8c2b8
commit e519eb9
Showing
7 changed files
with
88 additions
and
33 deletions.
There are no files selected for viewing
Submodule core
updated
6 files
+8 −0 | deno.jsonc | |
+1 −1 | package.json | |
+2 −1 | src/nako3.mts | |
+10 −0 | src/nako_lexer.mts | |
+1 −9 | src/plugin_system.mts | |
+1 −1 | test/plugin_system_test.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
/** get enviroment name */ | ||
export function getEnv(name: string): string | undefined { | ||
if (typeof (globalThis as any).process !== 'undefined' && (globalThis as any).process.env !== undefined) { | ||
return (globalThis as any).process.env[name] | ||
} | ||
if (typeof (globalThis as any).Deno !== 'undefined') { | ||
return (globalThis as any).Deno.env.get(name) | ||
} | ||
return undefined | ||
} | ||
|
||
/** check is windows */ | ||
export function isWindows(): boolean { | ||
if (typeof (globalThis as any).process !== "undefined" && (globalThis as any).process.platform) { | ||
return (globalThis as any).process.platform === "win32" | ||
} | ||
if (typeof (globalThis as any).Deno !== "undefined") { | ||
return (globalThis as any).Deno.build.os === "windows" | ||
} | ||
return false | ||
} | ||
|
||
/** get command line arguments */ | ||
export function getCommandLineArgs(): string[] { | ||
// Node.js | ||
if (typeof (globalThis as any).process !== "undefined" && (globalThis as any).process.argv) { | ||
return (globalThis as any).process.argv | ||
} | ||
// Deno | ||
if (typeof (globalThis as any).Deno !== "undefined") { | ||
const args = (globalThis as any).Deno.args | ||
args.unshift(new URL((globalThis as any).Deno.mainModule).pathname) | ||
args.unshift((globalThis as any).Deno.execPath()) | ||
return args | ||
} | ||
// Node.js環境の場合 | ||
return []; | ||
} | ||
|
||
/** Exit */ | ||
export function exit(code: number): void { | ||
if (typeof (globalThis as any).process !== 'undefined') { | ||
(globalThis as any).process.exit(code) | ||
} | ||
if (typeof (globalThis as any).Deno !== 'undefined') { | ||
(globalThis as any).Deno.exit(code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters