export async function handleListDeployments()

in src/commands/deployments/list.ts [30:57]


export async function handleListDeployments(argv: ArgumentsCamelCase) {
  if (!checkDirectory()) {
    return;
  }
  const projectConfig = getProjectConfig();
  if (!projectConfig) return logger.notInProject();

  const isSuccess = await checkIsLoginSuccess();
  if (!isSuccess) return;

  await validRoutine(projectConfig.name);

  const server = await ApiService.getInstance();

  const versionList = await getRoutineVersionList(projectConfig.name);
  const req: GetRoutineReq = { Name: projectConfig.name };
  const routineDetail = await server.getRoutine(req);

  if (!routineDetail) return;

  //测试环境版本
  const stagingVersion = routineDetail?.data?.Envs[1]?.CodeVersion;
  //生产环境版本
  const productionVersion = routineDetail?.data?.Envs[0]?.CodeVersion;

  await displayListPrompt(routineDetail);
  await displayVersionList(versionList, stagingVersion, productionVersion);
}