Merge pull request 'Release v0.4.0: Remove single/double quotes from DISABLED_PLATFORMS variable' (#108) from v0.4.0/fix-disabled-platforms-variable-issues into develop

Reviewed-on: #108
This commit is contained in:
lamacchinadesiderante 2024-05-27 09:54:18 +00:00
commit 120be7734c
1 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,9 @@ import { Platforms } from "@/meta/settings";
export const getEnabledPlatforms = ():string[] => { export const getEnabledPlatforms = ():string[] => {
if (process.env.DISABLED_PLATFORMS) { if (process.env.DISABLED_PLATFORMS) {
const disabledPlatforms: string[] = String(process.env.DISABLED_PLATFORMS).replace(/\s/g, "").split(',') const regex = /[ '\"]/g;
const disabledPlatforms: string[] = String(process.env.DISABLED_PLATFORMS).replace(regex, '').split(',')
return [...Object.values(Platforms)].filter(p => !disabledPlatforms.includes(p)) return [...Object.values(Platforms)].filter(p => !disabledPlatforms.includes(p))
} else { } else {