Skip to content

Commit f217035

Browse files
committed
add opt to disable revision tagging
1 parent adf44df commit f217035

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
revisionKey: function(context) {
3131
return context.revisionData && context.revisionData.revisionKey;
3232
},
33+
disableRevisionTagging: false,
3334

3435
didDeployMessage: function(context){
3536
return "Uploaded sourcemaps to sentry release: "
@@ -53,7 +54,18 @@ module.exports = {
5354
},
5455

5556
willUpload: function(context) {
56-
var revisionKey = context.revisionKey;
57+
var isDisabled = this.readConfig('disableRevisionTagging');
58+
if(isDisabled) {
59+
return;
60+
}
61+
62+
var revisionKey = this.readConfig('revisionKey');
63+
if(!revisionKey) {
64+
return new SilentError("Could not find revision key to fingerprint Sentry revision with.");
65+
}
66+
67+
// TODO instead of plainly reading index.html, minimatch
68+
// getConfig('revision patterns') on context.distFiles
5769
var indexPath = path.join(context.distDir, "index.html");
5870
var index = fs.readFileSync(indexPath, 'utf8');
5971
var index = index.replace('<meta name="sentry:revision">',

0 commit comments

Comments
 (0)