create-dwy 0.12.0 → 0.12.1
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
CHANGED
package/src/sync.js
CHANGED
|
@@ -109,17 +109,22 @@ async function scanHooks(sourceDir) {
|
|
|
109
109
|
const hooksDir = path.join(sourceDir, 'hooks')
|
|
110
110
|
if (!await fs.pathExists(hooksDir)) return []
|
|
111
111
|
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
.
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
const hooks = []
|
|
113
|
+
for (const cat of await fs.readdir(hooksDir, { withFileTypes: true })) {
|
|
114
|
+
if (!cat.isDirectory()) continue
|
|
115
|
+
const catDir = path.join(hooksDir, cat.name)
|
|
116
|
+
for (const entry of await fs.readdir(catDir, { withFileTypes: true })) {
|
|
117
|
+
if (entry.name === '.gitkeep') continue
|
|
118
|
+
hooks.push({
|
|
119
|
+
name: entry.name,
|
|
120
|
+
description: entry.isDirectory() ? '钩子目录' : '钩子脚本',
|
|
121
|
+
category: cat.name,
|
|
122
|
+
sourcePath: path.join(catDir, entry.name),
|
|
123
|
+
type: 'hook',
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return hooks.sort((a, b) => a.name.localeCompare(b.name))
|
|
123
128
|
}
|
|
124
129
|
|
|
125
130
|
async function scanExisting(projectTargetDir, typePlural) {
|
|
File without changes
|