You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.
var _upload = function(files, callback) {
var rootdir = files[0];
async.eachSeries(files, function(fpath, done) {
fs.stat(fpath, function(err, stats) {
// ...
if (stats.isFile()) {
var fname = path.relative(rootdir, fpath);
Problem occurs when files argument is [ 'file_A.js', 'file_B.js' ] (glob pattern 'file_' or './file_').
First file (A) transfers to remote host successfully, but second one (B) transfers to "one level up directory".
It happens because path.relative handles first argument as directory, and path.relative("file_A.js", "file_B.js") returns "..\file_B.js"
Buggy code located in scp.js
Problem occurs when files argument is [ 'file_A.js', 'file_B.js' ] (glob pattern 'file_' or './file_').
First file (A) transfers to remote host successfully, but second one (B) transfers to "one level up directory".
It happens because path.relative handles first argument as directory, and path.relative("file_A.js", "file_B.js") returns "..\file_B.js"
Ready code to reproduce:
The text was updated successfully, but these errors were encountered: