Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
sindresorhus committed Jul 5, 2023
1 parent d16cbcf commit 8a771d6
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 33 deletions.
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github: sindresorhus
open_collective: sindresorhus
tidelift: npm/gulp-chmod
custom: https://sindresorhus.com/donate
3 changes: 3 additions & 0 deletions .github/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 14
- 12
- 10
- 8
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const through = require('through2');
const deepAssign = require('deep-assign');
const merge = require('lodash.merge');
const Mode = require('stat-mode');

const defaultMode = 0o777 & (~process.umask());
Expand Down Expand Up @@ -55,7 +55,7 @@ module.exports = (fileMode, directoryMode) => {

if (typeof currentMode === 'object') {
const statMode = new Mode(file.stat);
deepAssign(statMode, normalize(currentMode));
merge(statMode, normalize(currentMode));
file.stat.mode = statMode.stat.mode;
} else {
file.stat.mode = currentMode;
Expand Down
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
Expand All @@ -28,12 +28,12 @@
"permissions"
],
"dependencies": {
"deep-assign": "^1.0.0",
"stat-mode": "^0.3.0",
"lodash.merge": "^4.6.2",
"stat-mode": "^1.0.0",
"through2": "^3.0.1"
},
"devDependencies": {
"mocha": "^6.1.4",
"mocha": "^6.2.0",
"vinyl": "^2.1.0",
"xo": "^0.24.0"
}
Expand Down
37 changes: 16 additions & 21 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# gulp-chmod [![Build Status](https://travis-ci.org/sindresorhus/gulp-chmod.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-chmod)
# gulp-chmod

> [Change permissions](https://en.wikipedia.org/wiki/Chmod) of [Vinyl](https://github.com/gulpjs/vinyl) files

## Install

```sh
npm install --save-dev gulp-chmod
```
$ npm install --save-dev gulp-chmod
```


## Usage

```js
const gulp = require('gulp');
const chmod = require('gulp-chmod');
import gulp from 'gulp';
import chmod from 'gulp-chmod';

gulp.task('default', () =>
export default () => (
gulp.src('src/app.js')
.pipe(chmod(0o755))
.pipe(gulp.dest('dist'))
Expand All @@ -26,10 +24,10 @@ gulp.task('default', () =>
or

```js
const gulp = require('gulp');
const chmod = require('gulp-chmod');
import gulp from 'gulp';
import chmod from 'gulp-chmod';

gulp.task('default', () =>
export default () => (
gulp.src('src/app.js')
.pipe(chmod({
owner: {
Expand All @@ -48,16 +46,15 @@ gulp.task('default', () =>
);
```


## API

### chmod(fileMode, [directoryMode])
### chmod(fileMode, directoryMode?)

#### fileMode

Type: `number | object`

Can either be a [chmod](http://ss64.com/bash/chmod.html) octal number or an object with the individual permissions specified.
Can either be a [chmod](https://ss64.com/bash/chmod.html) octal number or an object with the individual permissions specified.

Values depends on the current file, but these are the possible keys:

Expand Down Expand Up @@ -99,19 +96,18 @@ Same as `fileMode`, but applies to directories.

Specify `true` to use the same value as `fileMode`.


## Tip

Combine it with [gulp-filter](https://github.com/sindresorhus/gulp-filter) to only change permissions on a subset of the files.

```js
const gulp = require('gulp');
const gFilter = require('gulp-filter');
const chmod = require('gulp-chmod');
import gulp from 'gulp';
import chmod from 'gulp-chmod';
import gulpFilter from 'gulp-filter';

const filter = gFilter('src/cli.js', {restore: true});
const filter = gulpFilter('src/cli.js', {restore: true});

gulp.task('default', () =>
export default = () => (
gulp.src('src/*.js')
// Filter a subset of the files
.pipe(filter)
Expand All @@ -123,7 +119,6 @@ gulp.task('default', () =>
);
```


## Related

- [gulp-chown](https://github.com/sindresorhus/gulp-chown) - Change owner of Vinyl files

0 comments on commit 8a771d6

Please sign in to comment.