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

gulp-zip change folder permission, from 755 to 666 #112

Closed
NotCoderJack opened this issue Mar 7, 2019 · 6 comments · Fixed by #117
Closed

gulp-zip change folder permission, from 755 to 666 #112

NotCoderJack opened this issue Mar 7, 2019 · 6 comments · Fixed by #117
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt

Comments

@NotCoderJack
Copy link

NotCoderJack commented Mar 7, 2019

Issuehunt badges

Hi today my team member happened to meet this issue.

Normal:
image

But after gulp-zip:
image

and this issue only occurs on Windows, my machine is Mac, never has this problem.

Following is my code:

var gulp = require('gulp');
var gulpZip = require('gulp-zip');
var gulpIf = require('gulp-if');
var gulpChmod = require('gulp-chmod');
var gulpTap = require('gulp-tap');
var moment = require('moment');
var colors = require('colors[表情]fe');
// 打包
function isDirectory(file) {
    console.log(file, file.isDirectory())
    return file.isDirectory()
}
gulp.task('zip', function() {
    var timestamp = moment().format('YYYY-MM-DD_HHMMSS');
    var fileName = 'static-' + timestamp + '.zip';
    console.log(colors.green('*******COPY THIS PATH TO DEPLOY: ' + 'qly_industry/' + fileName))
    return gulp.src('./dist/**')
        // .pipe(gulpIf(isDirectory, gulpChmod(0o777)))
        .pipe(gulpTap(function(file) {
            if (file.isDirectory()) {
                file.stat.mode = parseInt(40755, 8)
            }
        }))
        .pipe(gulpZip(fileName))
        .pipe(gulp.dest('./dist'));
});

After I tried gulp-chmod and gulp-tap as other issues you mentioned to fix likely problem, still can't fix this issue!


IssueHunt Summary

jimbly jimbly has been rewarded.

Backers (Total: $30.00)

Submitted pull Requests


Tips

@NotCoderJack NotCoderJack changed the title gulp-zip change folder permission, from 755 to 766 gulp-zip change folder permission, from 755 to 666 Mar 7, 2019
@ghjagus
Copy link

ghjagus commented May 16, 2019

I met the problem too, is there any solutions?

@ghjagus
Copy link

ghjagus commented May 18, 2019

I met the problem too, is there any solutions?

Finally, i use archiver replace gulp-zip

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Jun 9, 2019
@IssueHuntBot
Copy link

@issuehunt has funded $30.00 to this issue.


@xuliangzhan
Copy link

I used gulp-chmod to solve it.

gulp.src('dist/**')
    .pipe(chmod(0o755, 0o755))
    .pipe(zip(`dist.zip`))
    .pipe(gulp.dest('./'))

@Cristy94
Copy link

This is a really, really big issue. Any progress on it or suggestions? Should we use chmod as @xuliangzhan suggested?

@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 27, 2020

@sindresorhus has rewarded $27.00 to @jimbly. See it on IssueHunt

  • 💰 Total deposit: $30.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $3.00

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants