Closed ghost closed 7 years ago
Thanks to share this issue. Could you please provide a pull request or paste the code you modified?
It's just a small fix, so I will provide the code of the modified func here. I changed relative paths to absolute paths.
decompressArchiveOnRemoteTask(done) { if (this.options.mode != 'archive') { done(); return; }
this.logger.subhead('Decompress archive on remote');
let spinner = this.logger.startSpinner('Decompressing');
const archivePath = path.posix.join(this.release.path, this.options.archiveName);
const untarMap = {
'zip': "unzip -q " + archivePath + " -d " + this.release.path + "/",
'tar': "tar -xvf " + archivePath + " -C " + this.release.path + "/",
};
// Check archiveType is supported
if (!untarMap[this.options.archiveType]) {
logger.fatal(this.options.archiveType + ' not supported.');
}
const command = [
untarMap[this.options.archiveType],
"rm " + archivePath,
].join('\n');
this.remote.exec(command, () => {
spinner.stop();
this.logger.ok('Done');
done();
});
}
I have just deployed a version 2.1.1 on npm with this fix. Thanks @verrydtj
The decompressArchiveOnRemoteTask does not work on my configuration. The "cd " + this.release.path command doesn't work so any of the following commands are performed on the root shell login. When I modify your code to use absolute paths for the untarring, just like you do with the rm, it's working perfectly. The server I am deploying to is an ubuntu 16.04. Maybe it is OS specific.