Skip to content

Commit

Permalink
fix(CLI): Handle gently case where temp folder is on other device
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 20, 2021
1 parent 3e19547 commit a030636
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils/logDeprecation.js
Expand Up @@ -8,6 +8,7 @@ const weakMemoizee = require('memoizee/weak');
const _ = require('lodash');
const resolveTmpdir = require('process-utils/tmpdir');
const ServerlessError = require('../serverless-error');
const safeMoveFile = require('./fs/safeMoveFile');
const { style, legacy, log } = require('@serverless/utils/log');
const healthStatusFilename = require('./health-status-filename');

Expand Down Expand Up @@ -162,7 +163,7 @@ module.exports.printSummary = async () => {
fse.ensureDir(path.dirname(healthStatusFilename)),
fsp.writeFile(tmpHealthStatusFilename, healthStatus.join('\n')),
]);
await fsp.rename(tmpHealthStatusFilename, healthStatusFilename);
await safeMoveFile(tmpHealthStatusFilename, healthStatusFilename);

if (bufferedDeprecations.length === 1) {
const { code, message } = bufferedDeprecations[0];
Expand Down

0 comments on commit a030636

Please sign in to comment.