This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install: Use EXDEV aware move instead of rename
This will allow moving across devices and moving when filesystems don't support renaming directories full of files. PR-URL: #15901 Credit: @iarna Reviewed-By: @zkat
- Loading branch information
Showing
65 changed files
with
16,209 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
module.exports = wrappedMove | ||
|
||
var fs = require('graceful-fs') | ||
var move = require('@npmcorp/move') | ||
var Bluebird = require('bluebird') | ||
|
||
function wrappedMove (from, to, cb) { | ||
var movePromise = move(from, to, {fs: fs, Promise: Bluebird, maxConcurrency: 4}) | ||
if (cb) { | ||
return movePromise.then(function (value) { | ||
cb(value) | ||
}, function (err) { | ||
cb(err) | ||
}) | ||
} else { | ||
return movePromise | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
'use strict' | ||
var fs = require('graceful-fs') | ||
var SaveStack = require('./save-stack.js') | ||
/* | ||
module.exports = rename | ||
This is a stub file to ensure that the following hack doesn't break. This can be removed w/ npm@5. | ||
function rename (from, to, cb) { | ||
var saved = new SaveStack(rename) | ||
fs.rename(from, to, function (er) { | ||
if (er) { | ||
return cb(saved.completeWith(er)) | ||
} else { | ||
return cb() | ||
} | ||
}) | ||
} | ||
# Fix bug https://github.com/npm/npm/issues/9863 | ||
RUN cd $(npm root -g)/npm \ | ||
&& npm install fs-extra \ | ||
&& sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js | ||
*/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
node_modules/@npmcorp/move/node_modules/@npmcorp/copy/LICENSE
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.