juice-email-cli 2.1.17 → 2.1.18

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/snippet.js +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juice-email-cli",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "description": "CLI tool to generate email-client-compatible HTML with juice (CSS inlining) + Mustache templating + minification",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/snippet.js CHANGED
@@ -574,9 +574,19 @@ async function runSnippetMode({ snippet, template, config: cliConfigPath, output
574
574
  templatePath = chosen.path;
575
575
  }
576
576
 
577
- // 自动检测片段目录下的配置文件(juice.yaml 优先,juice.yml 次之)
577
+ // 配置文件:非交互模式自动检测片段目录,交互模式提示用户选择
578
578
  const snippetDir = path.dirname(snippetPath);
579
- const priorityConfigPath = findLocalConfig(snippetDir);
579
+ let priorityConfigPath;
580
+
581
+ if (template) {
582
+ // 命令行完整指定(-s + -f),自动检测
583
+ priorityConfigPath = findLocalConfig(snippetDir);
584
+ } else {
585
+ // 交互模式(只有 -s),提示选择配置
586
+ const yamlFiles = findYamlFiles(snippetDir);
587
+ const configChoice = await promptConfigForInteractive(yamlFiles);
588
+ priorityConfigPath = (configChoice.type === 'file') ? configChoice.path : null;
589
+ }
580
590
 
581
591
  // 跨品牌检查:片段和模板品牌不一致时给出警告
582
592
  try {