diff --git a/scripts/set-env.ts b/scripts/set-env.ts index 0aa106538c..5eee22a4be 100644 --- a/scripts/set-env.ts +++ b/scripts/set-env.ts @@ -54,13 +54,6 @@ import(environmentFilePath) function generateEnvironmentFile(file: GlobalConfig): void { file.production = production; buildBaseUrls(file); - - // TODO remove workaround in beta 5 - if (file.rest.nameSpace.match("(.*)/api/?$") !== null) { - file.rest.nameSpace = getNameSpace(file.rest.nameSpace); - console.log(colors.white.bgMagenta.bold(`The rest.nameSpace property in your environment file or in your DSPACE_REST_NAMESPACE environment variable ends with '/api'.\nThis is deprecated. As '/api' isn't configurable on the rest side, it shouldn't be repeated in every environment file.\nPlease change the rest nameSpace to '${file.rest.nameSpace}'`)); - } - const contents = `export const environment = ` + JSON.stringify(file); writeFile(targetPath, contents, (err) => { if (err) { @@ -119,16 +112,5 @@ function getPort(port: number): string { } function getNameSpace(nameSpace: string): string { - // TODO remove workaround in beta 5 - const apiMatches = nameSpace.match("(.*)/api/?$"); - if (apiMatches != null) { - let newValue = '/' - if (hasValue(apiMatches[1])) { - newValue = apiMatches[1]; - } - return newValue; - } - else { - return nameSpace ? nameSpace.charAt(0) === '/' ? nameSpace : '/' + nameSpace : ''; - } + return nameSpace ? nameSpace.charAt(0) === '/' ? nameSpace : '/' + nameSpace : ''; }