Skip to content

Commit c8f3070

Browse files
committed
feat: added heroku image by default
1 parent 18b1a9d commit c8f3070

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

assets/heroku.png

141 KB
Loading

example.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {notify} from './src'
2+
3+
notify({message: 'test'})

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"node": ">=8.0.0"
2525
},
2626
"files": [
27+
"/assets",
2728
"/lib"
2829
],
2930
"homepage": "https://github.com/heroku/heroku-cli-notifications",

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import * as NodeNotifier from 'node-notifier'
2+
import * as path from 'path'
23

34
export interface Notification extends NodeNotifier.Notification {
45
force?: boolean
56
}
67

78
export function notify(notification: Notification = {}, callback?: NodeNotifier.NotificationCallback) {
8-
if (!notification.force || ['0', 'false'].includes(process.env.HEROKU_NOTIFICATIONS!)) return
9-
return NodeNotifier.notify(notification, callback)
9+
if (!notification.force && ['0', 'false'].includes(process.env.HEROKU_NOTIFICATIONS!)) return
10+
return NodeNotifier.notify({
11+
icon: path.join(__dirname, '../assets/heroku.png'),
12+
...notification,
13+
} as Notification, callback)
1014
}

0 commit comments

Comments
 (0)