getRepositoryPath static method

String getRepositoryPath(
  1. String pathRepo
)

基于现有仓库地址,获取正确可用的仓库地址

pathRepo 仓库地址

Implementation

static String getRepositoryPath(String pathRepo) {
  String pathRepository = pathRepo;
  // 增加处理 - 如果仓库路径使用ssh协议时,需要加上ssh://前缀
  if (RegExp('^git@').hasMatch(pathRepo) &&
      RegExp(':\\d*/').hasMatch(pathRepo)) {
    pathRepository = 'ssh://$pathRepo';
  }
  return pathRepository;
}