@@ -202,7 +202,7 @@ async function copyInternal(config, fromPath, toPath, options, progressCallback)
|
||||
if (!safe.fs.writeFileSync(identityFilePath, `${config.mountOptions.privateKey}\n`, { mode: 0o600 })) throw new BoxError(BoxError.FS_ERROR, `Could not write temporary private key: ${safe.error.message}`);
|
||||
|
||||
const sshOptions = [ '-o', 'StrictHostKeyChecking no', '-i', identityFilePath, '-p', config.mountOptions.port, `${config.mountOptions.user}@${config.mountOptions.host}` ];
|
||||
const sshArgs = sshOptions.concat([ 'cp', cpOptions, path.join(config.prefix ?? '', fromPath), path.join(config.prefix ?? '', toPath) ]);
|
||||
const sshArgs = sshOptions.concat([ 'cp', cpOptions, path.join(config.mountOptions.remoteDir, config.prefix ?? '', fromPath), path.join(config.mountOptions.remoteDir, config.prefix ?? '', toPath) ]);
|
||||
const [remoteCopyError] = await safe(shell.spawn('ssh', sshArgs, {}));
|
||||
safe.fs.unlinkSync(identityFilePath);
|
||||
if (!remoteCopyError) return;
|
||||
|
||||
Reference in New Issue
Block a user