Skip to content

Commit f27dce0

Browse files
committed
fix(plugin): allow no package.json
Signed-off-by: Tobias Gurtzick <[email protected]>
1 parent fae85cf commit f27dce0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ var log = require('db-migrate-shared').log;
66
exports.dataType = require('db-migrate-shared').dataType;
77

88
function loadPluginList (options) {
9+
try {
10+
fs.accessSync(path.join(options.cwd, 'package.json'), fs.constants.R_OK);
11+
} catch (err) {
12+
return {};
13+
}
14+
915
var plugins = JSON.parse(
1016
fs.readFileSync(path.join(options.cwd, 'package.json'), 'utf-8')
1117
);

0 commit comments

Comments
 (0)