diff --git a/index.d.ts b/index.d.ts index 4f1040e..de4d7b8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -130,6 +130,7 @@ declare namespace SentryCliPlugin { declare class SentryCliPlugin implements WebpackPluginInstance { options: SentryCliPlugin.SentryCliPluginOptions; constructor(options: SentryCliPlugin.SentryCliPluginOptions); + static cliBinaryExists(): string; apply(compiler: Compiler): void; } diff --git a/src/index.js b/src/index.js index abd0123..b210ead 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ const SentryCli = require('@sentry/cli'); +const fs = require('fs'); const path = require('path'); const util = require('util'); const { RawSource } = require('webpack-sources'); @@ -193,6 +194,10 @@ class SentryCliPlugin { return this.options.dryRun === true; } + static cliBinaryExists() { + return fs.existsSync(SentryCli.getPath()); + } + /** Creates a new Sentry CLI instance. */ getSentryCli() { const cli = new SentryCli(this.options.configFile, {