@htyf-mp/cli 0.2.0-alpha.8 → 0.2.0-alpha.9

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htyf-mp/cli",
3
- "version": "0.2.0-alpha.8",
3
+ "version": "0.2.0-alpha.9",
4
4
  "description": "红糖云服app小程序模板-cli",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,11 +25,28 @@ const PRESET_NAMES = {
25
25
  };
26
26
 
27
27
  export async function promptGodotOptions(defaults = {}) {
28
+ // 如果所有必需的值都已提供,直接返回,不进行询问
29
+ if (
30
+ defaults.targetBaseDir &&
31
+ defaults.projectDir &&
32
+ defaults.name &&
33
+ defaults.preset &&
34
+ defaults.platform
35
+ ) {
36
+ return {
37
+ targetBaseDir: String(defaults.targetBaseDir).trim(),
38
+ projectDir: String(defaults.projectDir).trim(),
39
+ name: String(defaults.name).trim(),
40
+ preset: String(defaults.preset).trim(),
41
+ platform: defaults.platform
42
+ };
43
+ }
44
+
28
45
  const answers = await inquirer.prompt([
29
46
  {
30
47
  type: 'input',
31
48
  name: 'targetBaseDir',
32
- message: '请输入导出目标根目录:',
49
+ message: '请输入导出目标根目录 (项目 dist 目录):',
33
50
  default: defaults.targetBaseDir || path.resolve(process.cwd(), './dist'),
34
51
  validate: (input) => !!input.trim() || '目标根目录不能为空'
35
52
  },
package/src/index.mjs CHANGED
@@ -138,8 +138,8 @@ async function Start(action) {
138
138
  try {
139
139
  const appConfigPath = path.join(projectPath, 'app.json');
140
140
  const appInfo = fse.readJsonSync(appConfigPath).htyf;
141
- const isGodot = fse.existsSync(path.join(projectPath, 'game.godot'));
142
-
141
+ const isGodot = fse.existsSync(path.join(projectPath, 'project.godot'));
142
+ Logger.info(`是否是Game项目: ${isGodot}`);
143
143
  if (!appInfo) {
144
144
  Logger.error('应用配置不存在,请先在app.json中配置htyf');
145
145
  return;