Skip to content

Commit

Permalink
fix(install): don't fail install if debug logs are present
Browse files Browse the repository at this point in the history
closes #173
- previously, `ghost install` would fail if there were debug log files
present in the install directory. This PR fixes it so log files don't
make the install exit
  • Loading branch information
acburdine committed Mar 16, 2017
1 parent 86c81ee commit 111e599
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/commands/install.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
const fs = require('fs-extra');
const path = require('path');
const every = require('lodash/every');
const Listr = require('listr');
const Promise = require('bluebird');
const symlinkSync = require('symlink-or-copy').sync;
Expand Down Expand Up @@ -55,7 +56,10 @@ module.exports.execute = function execute(version, options) {
process.chdir(dir);
}

if (fs.readdirSync(process.cwd()).length) {
let filesInDir = fs.readdirSync(process.cwd());

// Check if there are existing files that *aren't* ghost-cli debug log files
if (filesInDir.length && !every(filesInDir, (file) => file.match(/^ghost-cli-debug-.*\.log$/i))) {
return Promise.reject(new errors.SystemError('Current directory is not empty, Ghost cannot be installed here.'));
}

Expand Down

0 comments on commit 111e599

Please sign in to comment.