@@ -468,12 +468,13 @@ export async function deposit(session: ISession, opts: DepositOptions) {
468
468
469
469
let body : Element ;
470
470
if ( depositType === 'journal' ) {
471
- if ( ! journalTitle || ! journalDoi ) throw new Error ( 'Journal title and DOI are required' ) ;
471
+ if ( ! journalTitle ) throw new Error ( 'Journal title is required' ) ;
472
+ if ( ! journalDoi ) throw new Error ( 'Journal DOI is required' ) ;
472
473
let journalIssue : JournalIssue | undefined ;
473
474
console . log ( 'Deposit summary:' ) ;
474
475
console . log ( ' Journal:' ) ;
475
476
console . log ( ` Title: ${ journalTitle } ${ journalAbbr ? ` (${ journalAbbr } )` : '' } ` ) ;
476
- if ( journalDoi ) console . log ( ` Doi: ${ journalDoi } ` ) ;
477
+ console . log ( ` Doi: ${ journalDoi } ` ) ;
477
478
if ( volumeNumber || issueNumber || issueDoi ) {
478
479
if ( ! publicationDate ) {
479
480
throw new Error ( `publication date is required for journal issue` ) ;
@@ -492,10 +493,17 @@ export async function deposit(session: ISession, opts: DepositOptions) {
492
493
} ;
493
494
}
494
495
console . log ( ' Articles:' ) ;
496
+ const journalDoiPrefix = journalDoi . split ( '/' ) [ 0 ] ;
495
497
depositArticles . forEach ( ( { frontmatter } ) => {
496
498
console . log (
497
499
` ${ frontmatter . doi } - ${ frontmatter . title ?. slice ( 0 , 30 ) } ${ ( frontmatter . title ?. length ?? 0 ) > 30 ? '...' : '' } ` ,
498
500
) ;
501
+ const articleDoiPrefix = frontmatter . doi ?. split ( '/' ) [ 0 ] ;
502
+ if ( journalDoiPrefix !== articleDoiPrefix ) {
503
+ session . log . warn (
504
+ ` Article DOI prefix ${ articleDoiPrefix } does not match Journal DOI prefix ${ journalDoiPrefix } ` ,
505
+ ) ;
506
+ }
499
507
} ) ;
500
508
body = journalXml (
501
509
{
0 commit comments