From df46e7b430b3e41ae3029ea8a527d9481879f4c3 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Mon, 21 Oct 2024 09:46:39 -0600 Subject: [PATCH] better getRepos() function, https://github.com/phetsims/perennial/issues/364 Signed-off-by: Michael Kauzmann --- js/grunt/tasks/util/getRepo.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/grunt/tasks/util/getRepo.ts b/js/grunt/tasks/util/getRepo.ts index 9e62126d..75d78fdb 100644 --- a/js/grunt/tasks/util/getRepo.ts +++ b/js/grunt/tasks/util/getRepo.ts @@ -39,7 +39,13 @@ const getRepo = (): Repo => { }; export const getRepos = (): Repo[] => { - return getOption( 'repos' ) ? getOption( 'repos' ).split( ',' ) : []; + const reposArg = getOption( 'repos' ); + if ( reposArg ) { + assert( typeof reposArg === 'string', 'repos should be a comma separated list of values' ); + return getOption( 'repos' ).split( ',' ); + } + + return []; }; export default getRepo; \ No newline at end of file