Skip to content

Commit

Permalink
feat: Add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
schw4rzlicht committed Jun 11, 2020
1 parent 2ee8af3 commit 95ba4fe
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config.json
config.yml
sentry.json
.idea
dist
node_modules
16 changes: 16 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#!/usr/bin/env node

const fs = require("fs");

try {
const sentry = JSON.parse(fs.readFileSync("./sentry.json"));

if (sentry) {
const Sentry = require("@sentry/node");
const packageInformation = require("./package.json");
Sentry.init({
dsn: sentry.dsn,
release: 'twitch2ma@' + packageInformation.version
});
}
} catch(ignored){
}

require("./dist/lib/index").main();
113 changes: 112 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"prepare": "npm run build",
"buildYamlConfigSample": "json2yaml ./config.json.sample > ./config.yml.sample",
"validateConfig": "npm run validateConfigSchema && ajv validate -s src/resources/config.schema.json -d config.json.sample",
"validateConfigSchema": "ajv compile -s src/resources/**.schema.json"
"validateConfigSchema": "ajv compile -s src/resources/**.schema.json",
"prepublishOnly": "echo \"{ \\\"dsn\\\": \\\"$SENTRY_DSN\\\" }\" > sentry.json"
},
"author": {
"name": "Julian Rabe",
Expand All @@ -27,6 +28,7 @@
"license": "MIT",
"dependencies": {
"@d-fischer/typed-event-emitter": "^3.0.0",
"@sentry/node": "^5.17.0",
"ajv": "^6.12.2",
"chalk": "^4.0.0",
"commander": "^5.1.0",
Expand Down

0 comments on commit 95ba4fe

Please sign in to comment.