File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,16 @@ async function getNotificationDestination() {
115
115
return notificationDestination ;
116
116
}
117
117
118
+ let prefix // be filled in below...
118
119
function getPrefix ( ) {
119
- let prefix = cds . env . requires . notifications ?. prefix ;
120
- if ( prefix ) {
121
- return prefix === "$app-name" ? process . env . npm_package_name : prefix ;
122
- } else {
123
- return basename ( cds . root ) ;
124
- }
120
+ if ( ! prefix ) {
121
+ prefix = cds . env . requires . notifications ?. prefix
122
+ if ( prefix === "$app-name" ) try {
123
+ prefix = require ( cds . root + '/package.json' ) . name
124
+ } catch { prefix = null }
125
+ if ( ! prefix ) prefix = basename ( cds . root )
126
+ }
127
+ return prefix
125
128
}
126
129
127
130
function getNotificationTypesKeyWithPrefix ( notificationTypeKey ) {
You can’t perform that action at this time.
0 commit comments