sillyspec 3.10.2 → 3.10.3
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/package.json +1 -1
- package/src/run.js +14 -4
package/package.json
CHANGED
package/src/run.js
CHANGED
|
@@ -280,10 +280,20 @@ async function runStage(pm, progress, stageName, cwd) {
|
|
|
280
280
|
let currentIdx = steps.findIndex(s => s.status !== 'completed' && s.status !== 'skipped')
|
|
281
281
|
|
|
282
282
|
if (currentIdx === -1) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
// 已完成 → 自动重置,重新开始
|
|
284
|
+
const freshSteps = await getStageSteps(stageName, cwd, progress)
|
|
285
|
+
stageData.steps = freshSteps
|
|
286
|
+
? freshSteps.map(s => ({ name: s.name, status: 'pending' }))
|
|
287
|
+
: []
|
|
288
|
+
stageData.status = 'in-progress'
|
|
289
|
+
stageData.startedAt = new Date().toLocaleString('zh-CN', { hour12: false })
|
|
290
|
+
stageData.completedAt = null
|
|
291
|
+
pm._write(cwd, progress)
|
|
292
|
+
currentIdx = 0
|
|
293
|
+
console.log(`🔄 ${stageName} 阶段已自动重置,重新开始。\n`)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (currentIdx > 0) {
|
|
287
297
|
// 有进行中的步骤,提示用户
|
|
288
298
|
const completed = currentIdx
|
|
289
299
|
const total = steps.length
|