Skip to content

Commit

Permalink
fix: Load preset/config if semantic-release run as global install
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Oct 1, 2017
1 parent dfb6c22 commit 34d964b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/load/release-rules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const importCwd = require('import-cwd');
const importFrom = require('import-from');
const SemanticReleaseError = require('@semantic-release/error');
const RELEASE_TYPES = require('../default/release-types');

Expand All @@ -15,7 +15,10 @@ module.exports = ({releaseRules}) => {
let loadedReleaseRules;

if (releaseRules) {
loadedReleaseRules = typeof releaseRules === 'string' ? importCwd(releaseRules) : releaseRules;
loadedReleaseRules =
typeof releaseRules === 'string'
? importFrom.silent(__dirname, releaseRules) || importFrom(process.cwd(), releaseRules)
: releaseRules;

if (!Array.isArray(loadedReleaseRules)) {
throw new SemanticReleaseError(
Expand Down

0 comments on commit 34d964b

Please sign in to comment.