cartfile()

in src/langs/swift/package_info.js [77:96]


  cartfile() {
    let writepath = path.join(this.config.dir, 'Cartfile');
    let emitter = new Emitter(this.config);
    emitter.emitln('github aliyun/tea-swift ~> 1.0.0');
    Object.keys(this.dependencies).forEach((key) => {
      const item = this.dependencies[key];
      const meta = item.meta;
      let version = getReleaseVersion(meta);
      if (meta.swift && meta.swift.packageInfo && meta.swift.packageInfo.github) {
        emitter.emitln(`github ${meta.swift.packageInfo.github
          .replace('https://github.com/', '')
          .replace('http://github.com/', '')
          .replace('.git', '')} ~> ${version}`);
      } else {
        emitter.emitln(`github ${item.scope}/${item.package_name} ~> ${version}`);
      }
    });
    _dir(writepath);
    fs.writeFileSync(writepath, emitter.output);
  }