[Pkg-javascript-commits] [node-fs-extra] 01/03: New upstream version 4.0.3

Julien Puydt julien.puydt at laposte.net
Sat Dec 9 09:20:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

jpuydt-guest pushed a commit to branch master
in repository node-fs-extra.

commit 12483bf5634befc157a7092f65e3a1a163c498a8
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Sat Dec 9 08:57:53 2017 +0100

    New upstream version 4.0.3
---
 .github/issue_template.md |  4 ++++
 .npmignore                |  1 +
 CHANGELOG.md              |  6 ++++++
 docs/copy.md              |  2 +-
 docs/fs-read-write.md     |  2 +-
 lib/fs/index.js           | 15 +++++++++------
 lib/remove/rimraf.js      |  4 ++--
 package.json              |  2 +-
 8 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/.github/issue_template.md b/.github/issue_template.md
new file mode 100644
index 0000000..e3d10eb
--- /dev/null
+++ b/.github/issue_template.md
@@ -0,0 +1,4 @@
+<!-- Please fill out the following information if it applies to your issue: -->
+- **Operating System:**
+- **Node.js version:**
+- **`fs-extra` version:**
diff --git a/.npmignore b/.npmignore
index 68eefb7..86d2e3f 100644
--- a/.npmignore
+++ b/.npmignore
@@ -6,3 +6,4 @@ appveyor.yml
 lib/**/__tests__/
 test/readme.md
 test.js
+.github/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2fbada2..29a37b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+4.0.3 / 2017-12-05
+------------------
+
+- Fix wrong `chmod` values in `fs.remove()` [#501](https://github.com/jprichardson/node-fs-extra/pull/501)
+- Fix `TypeError` on systems that don't have some `fs` operations like `lchown` [#520](https://github.com/jprichardson/node-fs-extra/pull/520)
+
 4.0.2 / 2017-09-12
 ------------------
 
diff --git a/docs/copy.md b/docs/copy.md
index ff0811f..8440726 100644
--- a/docs/copy.md
+++ b/docs/copy.md
@@ -3,7 +3,7 @@
 Copy a file or directory. The directory can have contents. Like `cp -r`.
 
 - `src` `<String>`
-- `dest` `<String>`
+- `dest` `<String>` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)).
 - `options` `<Object>`
   - `overwrite` `<boolean>`: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior.
   - `errorOnExist` `<boolean>`: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`.
diff --git a/docs/fs-read-write.md b/docs/fs-read-write.md
index 5e5f420..805ea3c 100644
--- a/docs/fs-read-write.md
+++ b/docs/fs-read-write.md
@@ -2,7 +2,7 @@
 
 [`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback) & [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments.
 
-If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only availible in Node 8+) does.
+If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does.
 
 Here's the example promise usage:
 
diff --git a/lib/fs/index.js b/lib/fs/index.js
index 4352965..1821fd0 100644
--- a/lib/fs/index.js
+++ b/lib/fs/index.js
@@ -9,6 +9,7 @@ const api = [
   'chmod',
   'chown',
   'close',
+  'copyFile',
   'fchmod',
   'fchown',
   'fdatasync',
@@ -20,6 +21,7 @@ const api = [
   'link',
   'lstat',
   'mkdir',
+  'mkdtemp',
   'open',
   'readFile',
   'readdir',
@@ -33,12 +35,13 @@ const api = [
   'unlink',
   'utimes',
   'writeFile'
-]
-// Add methods that are only in some Node.js versions
-// fs.copyFile was added in Node.js v8.5.0
-typeof fs.copyFile === 'function' && api.push('copyFile')
-// fs.mkdtemp() was added in Node.js v5.10.0
-typeof fs.mkdtemp === 'function' && api.push('mkdtemp')
+].filter(key => {
+  // Some commands are not available on some systems. Ex:
+  // fs.copyFile was added in Node.js v8.5.0
+  // fs.mkdtemp was added in Node.js v5.10.0
+  // fs.lchown is not available on at least some Linux
+  return typeof fs[key] === 'function'
+})
 
 // Export all keys:
 Object.keys(fs).forEach(key => {
diff --git a/lib/remove/rimraf.js b/lib/remove/rimraf.js
index 15924c3..f078694 100644
--- a/lib/remove/rimraf.js
+++ b/lib/remove/rimraf.js
@@ -117,7 +117,7 @@ function fixWinEPERM (p, options, er, cb) {
     assert(er instanceof Error)
   }
 
-  options.chmod(p, 666, er2 => {
+  options.chmod(p, 0o666, er2 => {
     if (er2) {
       cb(er2.code === 'ENOENT' ? null : er)
     } else {
@@ -144,7 +144,7 @@ function fixWinEPERMSync (p, options, er) {
   }
 
   try {
-    options.chmodSync(p, 666)
+    options.chmodSync(p, 0o666)
   } catch (er2) {
     if (er2.code === 'ENOENT') {
       return
diff --git a/package.json b/package.json
index 5150365..8ceeb74 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "fs-extra",
-  "version": "4.0.2",
+  "version": "4.0.3",
   "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.",
   "homepage": "https://github.com/jprichardson/node-fs-extra",
   "repository": {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-fs-extra.git



More information about the Pkg-javascript-commits mailing list