yg-team-cli 2.1.9 → 2.3.0

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/dist/index.js CHANGED
@@ -177,6 +177,14 @@ var init_logger = __esm({
177
177
  const coloredLabel = chalk[labelColor](`[${label}]`);
178
178
  console.log(`${coloredLabel} ${text}`);
179
179
  }
180
+ /**
181
+ * 打印调试信息(灰色,仅在 DEBUG 模式下显示)
182
+ */
183
+ debug(text) {
184
+ if (process.env.DEBUG) {
185
+ console.debug(chalk.gray(`[DEBUG] ${text}`));
186
+ }
187
+ }
180
188
  };
181
189
  logger = new Logger();
182
190
  }
@@ -463,7 +471,7 @@ var init_user_config = __esm({
463
471
  try {
464
472
  const configDir = path5.dirname(this.configPath);
465
473
  await FileUtils.ensureDir(configDir);
466
- const configToSave = { ...config };
474
+ const configToSave = JSON.parse(JSON.stringify(config));
467
475
  if (configToSave.gitlab?.accessToken) {
468
476
  configToSave.gitlab.accessToken = this.encrypt(configToSave.gitlab.accessToken);
469
477
  }
@@ -783,11 +791,18 @@ var init_gitlab_api = __esm({
783
791
  */
784
792
  static parseProjectPath(repository) {
785
793
  let path18 = repository;
786
- path18 = path18.replace(/^https?:\/\//, "");
787
- path18 = path18.replace(/^git@/, "");
788
- const parts = path18.split("/");
789
- if (parts.length > 1) {
790
- path18 = parts.slice(1).join("/");
794
+ if (path18.startsWith("git@")) {
795
+ path18 = path18.replace(/^git@/, "");
796
+ const colonIndex = path18.indexOf(":");
797
+ if (colonIndex !== -1) {
798
+ path18 = path18.substring(colonIndex + 1);
799
+ }
800
+ } else {
801
+ path18 = path18.replace(/^https?:\/\//, "");
802
+ const parts = path18.split("/");
803
+ if (parts.length > 1) {
804
+ path18 = parts.slice(1).join("/");
805
+ }
791
806
  }
792
807
  path18 = path18.replace(/\.git$/, "");
793
808
  return path18;