qdmp-cli 0.1.15 → 0.1.16

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/constants.js CHANGED
@@ -1,16 +1,23 @@
1
1
  export const TEMPLATES = [
2
2
  {
3
3
  name: "default",
4
- value: "frontend/miniapp-taro-template",
5
- desc: "千岛小程序默认模版",
4
+ value: "git@github.com:EchoTechFE/qdmp-taro-template.git",
5
+ desc: "千岛小程序默认模版(2.0)",
6
6
  emoji: "🟢",
7
+ fullUrl: true,
7
8
  },
8
- {
9
- name: "h5",
10
- value: "frontend/h5-template",
11
- desc: "h5模版",
12
- emoji: "🔵",
13
- },
9
+ // {
10
+ // name: "qdmp",
11
+ // value: "frontend/miniapp-taro-template",
12
+ // desc: "千岛小程序默认模版(1.0)",
13
+ // emoji: "🟡",
14
+ // },
15
+ // {
16
+ // name: "h5",
17
+ // value: "frontend/h5-template",
18
+ // desc: "h5模版",
19
+ // emoji: "🔵",
20
+ // },
14
21
  ];
15
22
 
16
23
  export const WORKSPACE_DIR = "qdmp-output";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdmp-cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "qdmp-cli",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/utils/gitClone.js CHANGED
@@ -38,10 +38,13 @@ export const download = async (projectName, repo) => {
38
38
  const clone = async (repo, name) => {
39
39
  const spinner = ora("正在拉取项目......").start();
40
40
  try {
41
+ const repoUrl = repo.includes(":")
42
+ ? repo
43
+ : `git@g.echo.tech:${repo}.git`;
41
44
  await new Promise((resolve, reject) => {
42
45
  const child = spawn(
43
46
  "git",
44
- ["clone", "--depth", "1", `git@g.echo.tech:${repo}.git`, name],
47
+ ["clone", "--depth", "1", repoUrl, name],
45
48
  {
46
49
  stdio: ["ignore", "pipe", "pipe"],
47
50
  env: {
@@ -55,12 +58,16 @@ const clone = async (repo, name) => {
55
58
  if (code === 0) {
56
59
  resolve();
57
60
  } else {
61
+ const isGitHub = repoUrl.includes("github.com");
58
62
  reject(
59
63
  new Error(
60
64
  `git clone 失败 (退出码: ${code}),请检查:\n` +
61
65
  ` 1. 是否已配置 SSH 密钥:ssh-keygen -t ed25519\n` +
62
- ` 2. 是否已将公钥添加到 GitLab:cat ~/.ssh/id_ed25519.pub\n` +
63
- ` 3. 网络是否能访问 g.echo.tech`
66
+ (isGitHub
67
+ ? ` 2. 是否已将公钥添加到 GitHub:https://github.com/settings/keys\n` +
68
+ ` 3. 网络是否能访问 github.com`
69
+ : ` 2. 是否已将公钥添加到 GitLab:cat ~/.ssh/id_ed25519.pub\n` +
70
+ ` 3. 网络是否能访问 g.echo.tech`)
64
71
  )
65
72
  );
66
73
  }