jsir 1.1.7 → 1.1.8
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/cmd/ooa.js +8 -7
- package/package.json +1 -1
package/cmd/ooa.js
CHANGED
|
@@ -216,13 +216,13 @@ async function fileLine(name) {
|
|
|
216
216
|
let watcher = _Chokidar.watch([workFile]);
|
|
217
217
|
|
|
218
218
|
text = trim(text)
|
|
219
|
-
let lines =
|
|
220
|
-
let line = trim(lines[
|
|
219
|
+
let lines = getExeLines(text)
|
|
220
|
+
let line = trim(lines[0])
|
|
221
221
|
watcher
|
|
222
222
|
.on('change', async () => {
|
|
223
223
|
let newText = trim(String(_fs.readFileSync(workFile)))
|
|
224
|
-
let newLines =
|
|
225
|
-
let newLine = trim(newLines[
|
|
224
|
+
let newLines = getExeLines(newText)
|
|
225
|
+
let newLine = trim(newLines[0])
|
|
226
226
|
|
|
227
227
|
if (newLine
|
|
228
228
|
&& newLines.length >= lines.length
|
|
@@ -251,7 +251,7 @@ async function fileLine(name) {
|
|
|
251
251
|
info("fileLine open " + workFile)
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
function
|
|
254
|
+
function getExeLines(text) {
|
|
255
255
|
let lines = []
|
|
256
256
|
let nLine = []
|
|
257
257
|
let cLine = []
|
|
@@ -275,6 +275,8 @@ function getLines(text) {
|
|
|
275
275
|
|
|
276
276
|
if (!line.endsWith('*/')) {
|
|
277
277
|
nLine.push(line)
|
|
278
|
+
} else {
|
|
279
|
+
lines.push("")
|
|
278
280
|
}
|
|
279
281
|
continue
|
|
280
282
|
}
|
|
@@ -284,8 +286,7 @@ function getLines(text) {
|
|
|
284
286
|
if (cLine.length > 0) {
|
|
285
287
|
lines.push(cLine.join('\n'))
|
|
286
288
|
}
|
|
287
|
-
|
|
288
|
-
return lines.slice(1).reverse()
|
|
289
|
+
return lines.slice(1)
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
async function dealInitData() {
|