Skip to content
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

Flat structure #12

Closed
bdecarne opened this issue Apr 1, 2014 · 7 comments
Closed

Flat structure #12

bdecarne opened this issue Apr 1, 2014 · 7 comments

Comments

@bdecarne
Copy link

bdecarne commented Apr 1, 2014

Hi !

When i use the # feature on the angular ui bootstrap repo (https://github.com/angular-ui/bootstrap), the directory structure is flat : all files from the project are in the root directory.

i'm on windows

{
  "devDependencies": {
    "napa": "~0.4.1"
  },
  "scripts": {
    "install": "napa"
  },
  "napa": {
    "bootstrap": "twbs/bootstrap",
    "angular": "angular/bower-angular",
    "angular-ui-bootstrap": "angular-ui/bootstrap#v0.10.0"
  }
}
@shama
Copy link
Owner

shama commented Apr 1, 2014

It looks like the git tag for angular-ui/bootstrap should be: "angular-ui-bootstrap": "angular-ui/bootstrap#0.10.0" (without the 'v') based on their releases: https://github.com/angular-ui/bootstrap/releases

Also since that repo has a package.json you can use npm to install with: npm i angular-ui/bootstrap#0.10.0 --save

Try one of those and let me know if you still get a flat structure.

@shama
Copy link
Owner

shama commented Apr 10, 2014

Any update?

@jchills
Copy link

jchills commented Apr 22, 2014

I ran into this issue today where all the directories are removed and the files are are flattened out into the root. The problem seems to be isolated to extracting '.zip' files. If I force the '.tar.gz' extension then the directory structure is intact. Setting strip: 0 also leaves the hierarchy intact, but leaves the root folder.

@shama
Copy link
Owner

shama commented Apr 22, 2014

@jchills With the same angular-ui-bootstrap repo? If a different one, could you send me a link to try and the expected folder structure? Thanks!

@jchills
Copy link

jchills commented Apr 22, 2014

@shama All these repos had the same problem. If you remove the version number, they install correctly.

"devDependencies": {
    "napa": "^0.4.1"
},
"scripts": {
    "install": "napa"
},
"napa": {
    "angular-bootstrap": "angular-ui/bootstrap#0.10.0",
    "angular-kendo": "kendo-labs/angular-kendo#1.0.0",
    "bootstrap": "twbs/bootstrap#v3.1.1",
    "jquery": "jquery/jquery#1.11.0",
    "kendo-ui": "kendo-labs/bower-kendo-ui#2014.1.318"
}

Here is what I would expect the root folder to look like after Napa installs the repo

Repo Folders Files
angular-bootstrap 4 - docs, misc, src, template 10
angular-kendo 4 - app, demos, nuget, test 12
bootstrap 7 - dist, docs, font, grunt, js, less, test-infra 13
jQuery 5 - build, dist, speed, src, test 17
kendo-ui 3 - js, src, styles 4

Here was the change I made in index.js that resolved the problem locally. I'm running on a Windows system, so it was forcing the ".zip" extension.

  if (url.indexOf('#') !== -1 && url.indexOf('://') === -1) {
    var s = url.split('#')
    url = 'https://github.com/' + s[0] + '/archive/' + s[1]

    // JH - Force the .tar.gz file extension because the .zip version isn't extracting correctly.
    url += '.tar.gz'
  }

Let me know if you need anything else.

@caseyWebb
Copy link
Collaborator

Closed via 63a040b

@9mm
Copy link

9mm commented Feb 10, 2016

This still happens for me when trying to download (it flattens everything and destroys the zip structure): https://origincache.facebook.com/developers/resources/?id=FacebookSDKs-iOS-20160210.zip

I can't add FB IOS SDK from facebook because it's a different structure than their finalized zip from this page

https://developers.facebook.com/docs/ios/downloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants