Skip to content

Commit

Permalink
fix(Standalone): Fix upgrade command
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Dec 10, 2020
1 parent d102a39 commit f23e50b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/standalone/index.js
Expand Up @@ -11,7 +11,7 @@ const isStandaloneExecutable =
require('../../utils/isStandaloneExecutable') && process.platform !== 'win32';
const standaloneUtils = require('../../utils/standalone');

const BINARY_TMP_PATH = os.tmpdir();
const BINARY_TMP_PATH = path.resolve(os.tmpdir(), 'serverless-binary-tmp');
const BINARY_PATH = standaloneUtils.path;

module.exports = class Standalone {
Expand Down Expand Up @@ -78,6 +78,7 @@ module.exports = class Standalone {
`(server rejected request with ${standaloneResponse.status})`
);
}
await fse.remove(BINARY_TMP_PATH);
await streamPromise(standaloneResponse.body.pipe(fs.createWriteStream(BINARY_TMP_PATH)));
await fse.rename(BINARY_TMP_PATH, BINARY_PATH);
await fse.chmod(BINARY_PATH, 0o755);
Expand Down

0 comments on commit f23e50b

Please sign in to comment.