juice-email-cli 2.3.9 → 2.3.10
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/init.js +12 -3
- package/src/view.js +2 -1
package/package.json
CHANGED
package/src/init.js
CHANGED
|
@@ -195,7 +195,7 @@ async function interactiveInit(edmDir, cwd) {
|
|
|
195
195
|
console.log(chalk.dim(`\n 品牌:${brand.meta.name || brand.name} → 模板:${version.meta.name || version.name}`));
|
|
196
196
|
if (series) console.log(chalk.dim(` 系列:${series.meta.name || series.name}${variant ? ' → 变体:' + (variant.meta.name || variant.name) : ''}`));
|
|
197
197
|
|
|
198
|
-
// Loop:
|
|
198
|
+
// Loop: confirm / shortcuts / customize, allow back at any point
|
|
199
199
|
let selected = copyItems.filter(c => c.checked).map(c => c.value);
|
|
200
200
|
while (true) {
|
|
201
201
|
const picked = selected
|
|
@@ -207,7 +207,11 @@ async function interactiveInit(edmDir, cwd) {
|
|
|
207
207
|
if (picked.length > 0) {
|
|
208
208
|
mainChoices.push({ name: `✅ 确认拷贝(${summary})`, value: 'confirm' });
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
// Quick shortcut: snippet + config only (skip template)
|
|
211
|
+
if (variant && copyItems.some(c => c.value === 'snippet') && copyItems.some(c => c.value === 'config')) {
|
|
212
|
+
mainChoices.push({ name: '🧩 仅片段 + 配置', value: 'snippet-config' });
|
|
213
|
+
}
|
|
214
|
+
mainChoices.push({ name: `🔄 自定义选择(${summary})`, value: 'edit' });
|
|
211
215
|
|
|
212
216
|
const action = await selectWithNav(
|
|
213
217
|
'拷贝操作:',
|
|
@@ -225,6 +229,10 @@ async function interactiveInit(edmDir, cwd) {
|
|
|
225
229
|
if (selected.length === 0) { console.log(chalk.dim(' (已清空选择)\n')); }
|
|
226
230
|
continue;
|
|
227
231
|
}
|
|
232
|
+
if (action === 'snippet-config') {
|
|
233
|
+
selected = ['snippet', 'config'];
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
228
236
|
|
|
229
237
|
if (selected.length === 0) {
|
|
230
238
|
console.log(chalk.gray('未选择任何内容。\n'));
|
|
@@ -339,7 +347,8 @@ function copyIcon(variantDir, versionDir, brandDir, cwd) {
|
|
|
339
347
|
} catch (_) {}
|
|
340
348
|
for (const src of candidates) {
|
|
341
349
|
if (fs.existsSync(src)) {
|
|
342
|
-
const dest =
|
|
350
|
+
const dest = path.join(cwd, 'favicon.ico');
|
|
351
|
+
fs.copyFileSync(src, dest);
|
|
343
352
|
return dest;
|
|
344
353
|
}
|
|
345
354
|
}
|
package/src/view.js
CHANGED
|
@@ -634,7 +634,8 @@ async function interactiveBrowse(edmDir, startParsed) {
|
|
|
634
634
|
];
|
|
635
635
|
for (const isrc of iconSrcs) {
|
|
636
636
|
if (fs.existsSync(isrc)) {
|
|
637
|
-
const idest =
|
|
637
|
+
const idest = path.join(cwd, 'favicon.ico');
|
|
638
|
+
fs.copyFileSync(isrc, idest);
|
|
638
639
|
console.log(` ${chalk.cyan('·')} ${cwdRel(idest)} ${chalk.gray('(图标, ' + fmtBytes(fs.statSync(idest).size) + ')')}`);
|
|
639
640
|
break;
|
|
640
641
|
}
|