Giter Site home page Giter Site logo

Comments (10)

kevva avatar kevva commented on May 25, 2024

Hmm, it seems like you have files without file.path.

from gulp-zip.

adam-lynch avatar adam-lynch commented on May 25, 2024

Hmm don't see how that could be;

    gulp.src source
        .pipe $.zip generateZipName(...)
        .pipe gulp.dest paths.dist.root
        .pipe $.size {showFiles: true}
        .on 'finish', done
    return

from gulp-zip.

kevva avatar kevva commented on May 25, 2024

Well, the error suggests that. The metadataPath is pathname on this and this line. But yeah, it sounds weird.

from gulp-zip.

adam-lynch avatar adam-lynch commented on May 25, 2024

I logged the file after the gulp.src;

  • file.cwd: /Users/adam/Code/GitHub/teamwork-chat-client
  • file.base: /Users/adam/Code/GitHub/teamwork-chat-client/dist/TeamworkChat/osx32/
  • file.path: /Users/adam/Code/GitHub/teamwork-chat-client/dist/TeamworkChat/osx32
  • file.stat:
{ dev: 16777218,
  mode: 16877,
  nlink: 3,
  uid: 502,
  gid: 20,
  rdev: 0,
  blksize: 4096,
  ino: 42474491,
  size: 102,
  blocks: 0,
  atime: Tue Mar 31 2015 17:47:18 GMT+0100 (IST),
  mtime: Tue Mar 31 2015 17:47:17 GMT+0100 (IST),
  ctime: Tue Mar 31 2015 17:47:17 GMT+0100 (IST) }

The glob passed to gulp.src is ./dist/TeamworkChat/osx32/**/**.

from gulp-zip.

adam-lynch avatar adam-lynch commented on May 25, 2024

That was on OSX (Mavericks) where ./dist/TeamworkChat/osx32 contained a single .app.

I've gotten the same error on Windows 8. I use the same wrapper function so the call is the same except on Windows the glob is ./dist/TeamworkChat/win32/**/** and ./dist/TeamworkChat/win32/ contains the following:

image

from gulp-zip.

kevva avatar kevva commented on May 25, 2024

Do you mind creating a repo with your stuff so I can test?

from gulp-zip.

adam-lynch avatar adam-lynch commented on May 25, 2024

@kevva here ya go: https://github.com/adam-lynch/gulp-zip-metadata-error

from gulp-zip.

DavidRogers avatar DavidRogers commented on May 25, 2024

I am getting the same exact error on Window 8...
my gruntfile.js:

var gulp = require('gulp');
var zip = require('gulp-zip');

var paths = {
    src: ['images/**', 'lib/**', 'index.html', 'main.js']
};

gulp.task('default', function () {
    return gulp.src(paths.src)
        .pipe(zip('MyZippedFile.zip'))
        .pipe(gulp.dest('../'));
});

I played around a little and found that it will only work if I specify a single file such as 'index.html' but if I used a file glob it will fail with this error.

EDIT: This seems to be broken only in v3.0.0, I ran the same code with v2.0.3 and it works fine.

from gulp-zip.

kevva avatar kevva commented on May 25, 2024

@adam-lynch, works fine for me using this:

gulp.task('default', function () {
    return gulp.src('dist/TeamworkChat/win32/**/*')
        .pipe(zip('archive.zip'))
        .pipe(gulp.dest('dist'));
});

Because you are using globs that ends with ** some directories doesn't have file.relative set. Best way to avoid this issue is to use **/* or just *.

from gulp-zip.

adam-lynch avatar adam-lynch commented on May 25, 2024

Thanks

from gulp-zip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.