lukintosh-lknt 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/bin/lknt.js +44 -0
  3. package/package.json +16 -0
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # LKNT§ CLI
2
+
3
+ LKNT§ is an experimental multi-target programming language and toolchain by Lukintosh.
4
+
5
+ ## Install
6
+
7
+ npm install -g @lukintosh/lknt
8
+
9
+ ## Usage
10
+
11
+ lknt --version
12
+ lknt run src/main.lknt
13
+ lknt build src/main.lknt --target native
14
+ lknt build src/main.lknt --target all
15
+
16
+ This package currently works as a wrapper for the LKNT§ CLI installed on your system.
package/bin/lknt.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("child_process");
4
+ const fs = require("fs");
5
+
6
+ const candidates = [
7
+ "C:\\LKNT\\bin\\lknt.exe",
8
+ "C:\\LKNT\\bin\\LKNT.Cli.exe",
9
+ "lknt.exe",
10
+ "LKNT.Cli.exe"
11
+ ];
12
+
13
+ let exe = null;
14
+
15
+ for (const candidate of candidates) {
16
+ if (candidate.includes("\\") && fs.existsSync(candidate)) {
17
+ exe = candidate;
18
+ break;
19
+ }
20
+
21
+ if (!candidate.includes("\\")) {
22
+ exe = candidate;
23
+ break;
24
+ }
25
+ }
26
+
27
+ if (!exe) {
28
+ console.error("LKNT§ CLI was not found.");
29
+ console.error("Make sure LKNT§ is installed in C:\\LKNT\\bin or available in PATH.");
30
+ process.exit(1);
31
+ }
32
+
33
+ const result = spawnSync(exe, process.argv.slice(2), {
34
+ stdio: "inherit",
35
+ shell: false
36
+ });
37
+
38
+ if (result.error) {
39
+ console.error("LKNT§ CLI was not found.");
40
+ console.error("Make sure LKNT§ is installed in C:\\LKNT\\bin or available in PATH.");
41
+ process.exit(1);
42
+ }
43
+
44
+ process.exit(result.status ?? 0);
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "lukintosh-lknt",
3
+ "version": "0.1.0",
4
+ "description": "LKNT§ programming language CLI wrapper.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "Lucas Correa",
11
+ "license": "MIT",
12
+ "type": "commonjs",
13
+ "bin": {
14
+ "lknt": "./bin/lknt.js"
15
+ }
16
+ }