Resolve env flags to boolean early
So inner functions can assume booleans and forget about the fact that they were once strings. Also allow both true and 1 to set it.main
parent
60ae549d13
commit
81e11cde9b
|
@ -115,8 +115,8 @@ async function main() {
|
|||
return;
|
||||
}
|
||||
|
||||
const mirrorPrivateRepositories = process.env.MIRROR_PRIVATE_REPOSITORIES;
|
||||
if(mirrorPrivateRepositories === 'true' && !githubToken){
|
||||
const mirrorPrivateRepositories = ['1', 'true'].includes(process.env.MIRROR_PRIVATE_REPOSITORIES)
|
||||
if(mirrorPrivateRepositories && !githubToken){
|
||||
console.error('MIRROR_PRIVATE_REPOSITORIES was set to true but no GITHUB_TOKEN was specified, please specify! Exiting..')
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue