New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle getting README/CHANGELOG from source :http with zip #1

Open
orta opened this Issue Mar 16, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@orta
Member

orta commented Mar 16, 2018

I have some example code that I've been playing with:

import * as request from "request"
import * as unzipper from "unzipper"
import { CentralDirectory } from "unzipper"

interface ZipMD {
  readme?: string
  changelog?: string
}

// export const getREADMEAndCHANGELOGFromZipAtURL = async (url: string): Promise<ZipMD> => {
//   const zip: CentralDirectory = (await unzipper.Open.url(request as any, url)) as any
//   console.log("OK")
//   console.log(zip)
//   if (!zip) {
//     return {}
//   }

//   const zipMD: ZipMD = {}

//   const readme = zip.files.find(file => file.path === "README.md")
//   if (readme) {
//     const readmeBuffer = await readme.buffer
//     zipMD.readme = readmeBuffer.toString()
//   }
//   debugger
//   return zipMD
// }

// unzipper.Open.url(request,'http://www2.census.gov/geo/tiger/TIGER2015/ZCTA5/tl_2015_us_zcta510.zip')
//   .then(function(d) {
//     var file = d.files.filter(function(d) {
//       return d.path === 'tl_2015_us_zcta510.shp.iso.xml';
//     })[0];
//     return file.buffer();
//   })
//   .then(function(d) {
//     console.log(d.toString());
//   });
// debugger
// ;(unzipper.Open.url(request as any, "https://github.com/kevva/decompress/archive/master.zip") as any)
//   .then((d: any) => {
//     debugger
//     console.log("OK")
//     const readme = d.files.find((file: any) => file.path === "README.md")
//     return readme.buffer()
//   })
//   .then((d: Buffer) => {
//     console.log(d.toString())
//   })
//   .error((e: any) => console.error(e))

// getREADMEAndCHANGELOGFromZipAtURL("https://github.com/kevva/decompress/archive/master.zip")
@Parabak

This comment has been minimized.

Parabak commented May 25, 2018

Hi @orta , I have a suggestion how to deal with not open source pods in another way?

Maybe new property can be inroduced to Podspec like spec.readme = 'http://***.com'. I think it can be good workaround for frameworks, what do you think?

Best regards Alex.

@Kjens93

This comment has been minimized.

Kjens93 commented Jun 5, 2018

Hey @orta, is anyone working on this?? I think rolling this out has broken README parsing for all pods using http sources. We need to either get this done ASAP or roll back to whatever was doing the parsing before.

@orta

This comment has been minimized.

Member

orta commented Jun 5, 2018

Afraid that’s not an option as cocoadocs was deprecated over a year ago, you’re welcome to take a look, otherwise I’ll get round to it when I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment