starlight-cli 1.0.10 → 1.0.11
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.
- package/dist/index.js +8 -6
- package/package.json +1 -1
- package/src/starlight.js +8 -6
package/dist/index.js
CHANGED
|
@@ -2454,7 +2454,7 @@ const Lexer = __nccwpck_require__(211);
|
|
|
2454
2454
|
const Parser = __nccwpck_require__(222);
|
|
2455
2455
|
const Evaluator = __nccwpck_require__(112);
|
|
2456
2456
|
|
|
2457
|
-
const VERSION = '1.0.
|
|
2457
|
+
const VERSION = '1.0.11';
|
|
2458
2458
|
|
|
2459
2459
|
const COLOR = {
|
|
2460
2460
|
reset: '\x1b[0m',
|
|
@@ -2537,8 +2537,8 @@ if (args[0] === '--learn') {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
|
|
2539
2539
|
if (args[0] === '--viewfilelist') {
|
|
2540
|
-
const
|
|
2541
|
-
let folderPath =
|
|
2540
|
+
const readlineSync = __nccwpck_require__(552);
|
|
2541
|
+
let folderPath = readlineSync.question(COLOR.cyan + 'Paste folder path to search .sl files: ' + COLOR.reset).trim();
|
|
2542
2542
|
if (!folderPath) return waitAndExit(0);
|
|
2543
2543
|
|
|
2544
2544
|
if (!fs.existsSync(folderPath) || !fs.lstatSync(folderPath).isDirectory()) {
|
|
@@ -2579,8 +2579,8 @@ if (args[0] === '--writedirectly') {
|
|
|
2579
2579
|
}
|
|
2580
2580
|
|
|
2581
2581
|
let coloredLine = line
|
|
2582
|
-
.replace(/"(.*?)"/g, COLOR.yellow + '"$1"' + COLOR.reset)
|
|
2583
|
-
.replace(/\b(sldeploy|import|from|const|let|var|if|else|for|while|func|return|break|continue|define|ask)\b/g, COLOR.blue + '$1' + COLOR.reset);
|
|
2582
|
+
.replace(/"(.*?)"/g, COLOR.yellow + '"$1"' + COLOR.reset)
|
|
2583
|
+
.replace(/\b(sldeploy|import|from|const|let|var|if|else|for|while|func|return|break|continue|define|ask)\b/g, COLOR.blue + '$1' + COLOR.reset);
|
|
2584
2584
|
|
|
2585
2585
|
console.log(coloredLine);
|
|
2586
2586
|
|
|
@@ -2671,7 +2671,9 @@ function runFile(filePath, isTemp = false, callback = null) {
|
|
|
2671
2671
|
waitAndExit(0);
|
|
2672
2672
|
}
|
|
2673
2673
|
|
|
2674
|
-
|
|
2674
|
+
if (!['--writedirectly', '--viewfilelist', '--learn', '--help', '-v', '--version'].includes(args[0])) {
|
|
2675
|
+
runFile(path.resolve(args[0]));
|
|
2676
|
+
}
|
|
2675
2677
|
|
|
2676
2678
|
module.exports = __webpack_exports__;
|
|
2677
2679
|
/******/ })()
|
package/package.json
CHANGED
package/src/starlight.js
CHANGED
|
@@ -7,7 +7,7 @@ const Lexer = require('./lexer');
|
|
|
7
7
|
const Parser = require('./parser');
|
|
8
8
|
const Evaluator = require('./evaluator');
|
|
9
9
|
|
|
10
|
-
const VERSION = '1.0.
|
|
10
|
+
const VERSION = '1.0.11';
|
|
11
11
|
|
|
12
12
|
const COLOR = {
|
|
13
13
|
reset: '\x1b[0m',
|
|
@@ -90,8 +90,8 @@ if (args[0] === '--learn') {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
if (args[0] === '--viewfilelist') {
|
|
93
|
-
const
|
|
94
|
-
let folderPath =
|
|
93
|
+
const readlineSync = require('readline-sync');
|
|
94
|
+
let folderPath = readlineSync.question(COLOR.cyan + 'Paste folder path to search .sl files: ' + COLOR.reset).trim();
|
|
95
95
|
if (!folderPath) return waitAndExit(0);
|
|
96
96
|
|
|
97
97
|
if (!fs.existsSync(folderPath) || !fs.lstatSync(folderPath).isDirectory()) {
|
|
@@ -132,8 +132,8 @@ if (args[0] === '--writedirectly') {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
let coloredLine = line
|
|
135
|
-
.replace(/"(.*?)"/g, COLOR.yellow + '"$1"' + COLOR.reset)
|
|
136
|
-
.replace(/\b(sldeploy|import|from|const|let|var|if|else|for|while|func|return|break|continue|define|ask)\b/g, COLOR.blue + '$1' + COLOR.reset);
|
|
135
|
+
.replace(/"(.*?)"/g, COLOR.yellow + '"$1"' + COLOR.reset)
|
|
136
|
+
.replace(/\b(sldeploy|import|from|const|let|var|if|else|for|while|func|return|break|continue|define|ask)\b/g, COLOR.blue + '$1' + COLOR.reset);
|
|
137
137
|
|
|
138
138
|
console.log(coloredLine);
|
|
139
139
|
|
|
@@ -224,4 +224,6 @@ function runFile(filePath, isTemp = false, callback = null) {
|
|
|
224
224
|
waitAndExit(0);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
if (!['--writedirectly', '--viewfilelist', '--learn', '--help', '-v', '--version'].includes(args[0])) {
|
|
228
|
+
runFile(path.resolve(args[0]));
|
|
229
|
+
}
|