Don't use CI_PAGES_URL after all
This commit is contained in:
parent
446b9b9bb1
commit
39132d7e0e
1 changed files with 1 additions and 15 deletions
|
@ -9,7 +9,6 @@ const { trimEnd } = require('lodash');
|
|||
const {
|
||||
BACKEND_URL,
|
||||
FE_BASE_PATH,
|
||||
CI_PAGES_URL,
|
||||
} = process.env;
|
||||
|
||||
const sanitizeURL = url => {
|
||||
|
@ -21,21 +20,8 @@ const sanitizeURL = url => {
|
|||
};
|
||||
|
||||
// Run Soapbox FE from a subdirectory.
|
||||
// If FE_BASE_PATH (eg '/web') is provided, prefer it.
|
||||
// For GitLab Pages builds, CI_PAGES_URL will be used.
|
||||
const getFeBasePath = () => {
|
||||
if (FE_BASE_PATH) {
|
||||
return trimEnd(FE_BASE_PATH, '/');
|
||||
} else if (CI_PAGES_URL) {
|
||||
try {
|
||||
const { pathname } = new URL(CI_PAGES_URL);
|
||||
return trimEnd(pathname, '/');
|
||||
} catch {
|
||||
return '/';
|
||||
}
|
||||
} else {
|
||||
return '/';
|
||||
}
|
||||
return trimEnd(FE_BASE_PATH, '/') || '/';
|
||||
};
|
||||
|
||||
// JSON.parse/stringify is to emulate what @preval is doing and avoid any
|
||||
|
|
Loading…
Reference in a new issue