Skip to content

Commit

Permalink
Fix VITE_FULL_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Mar 12, 2024
1 parent effb332 commit 622365f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
VITE_VERSION=$npm_package_version
VITE_NAME=$npm_package_name
VITE_FULL_URL=/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.env

# dependencies
/node_modules
/.pnp
Expand Down
14 changes: 9 additions & 5 deletions bin/print-ci-env-public-url.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/usr/bin/env node
let url;
let baseUrl;
if (process.env.GITHUB_REPOSITORY_OWNER === "microbit-foundation") {
// STAGE must be defined before this is imported
const { bucketPrefix } = require("../deployment.cjs");
url = `/${bucketPrefix}/`;
baseUrl = `/${bucketPrefix}/`;
} else {
url = "/";
baseUrl = "/";
}
const fullUrl = `https://${bucketName}${baseUrl}`;

// Two env vars as PUBLIC_URL seems to be blank when running jest even if we set it.
console.log(`PUBLIC_URL=${url}`);
console.log(`E2E_PUBLIC_URL=${url}`);
console.log(`PUBLIC_URL=${baseUrl}`);
console.log(`E2E_PUBLIC_URL=${baseUrl}`);
// This is used for og:url and similar. Not quite right for review domain but we don't really care.
console.log(`VITE_FULL_URL=${fullUrl}`);

0 comments on commit 622365f

Please sign in to comment.