File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1- const getConfig = require ( 'semantic-release/lib/get-config' ) ;
2- const getLogger = require ( 'semantic-release/lib/get-logger' ) ;
1+ let getConfig = null ,
2+ getLogger = null ;
3+ try {
4+ getConfig = require ( 'semantic-release/lib/get-config' ) ;
5+ getLogger = require ( 'semantic-release/lib/get-logger' ) ;
6+ } catch ( err ) {
7+ if ( err . code !== 'MODULE_NOT_FOUND' ) throw err ;
8+ }
39const { Writable } = require ( 'stream' ) ;
410
511const devNull = ( ) =>
@@ -15,6 +21,10 @@ const devNull = () =>
1521 * @return {Promise<Object> } The configuration object, which includes an options field among others.
1622 */
1723async function getReleaseConfig ( ) {
24+ if ( ! getLogger || ! getConfig ) {
25+ throw new Error ( 'cannot get release config - semantic-release not available' ) ;
26+ }
27+
1828 const context = {
1929 cwd : process . cwd ( ) ,
2030 // The logger logs a bunch of unhelpful stuff when loading plugins, and we're only loading
You can’t perform that action at this time.
0 commit comments