first load
Some checks failed
Build, Push, Publish / Build & Release (push) Failing after 2s
Sync Repo / sync (push) Failing after 2s

This commit is contained in:
2025-12-16 04:40:00 -03:00
parent 9f33a94e0e
commit 6fa41a771d
856 changed files with 70411 additions and 1 deletions

36
bin/lighthouse/account.js Normal file
View File

@@ -0,0 +1,36 @@
/**
* Reads account information from env variables or .a11yrc.json file
*/
const fs = require("fs");
let a11yAccount = {};
const a11yrcFilePath = ".a11yrc.json";
if (fs.existsSync(a11yrcFilePath)) {
a11yAccount = JSON.parse(fs.readFileSync(a11yrcFilePath));
}
function isValid(account) {
return account.subdomain && account.email && account.password;
}
function getAccount() {
// Reads account from the env or .a11yrc.json file if present
let account = {
subdomain: process.env.subdomain || a11yAccount.subdomain,
email: process.env.end_user_email || a11yAccount.username,
password: process.env.end_user_password || a11yAccount.password,
urls: process.env?.urls?.trim()?.split(/\s+/) || a11yAccount.urls
};
if (!isValid(account)) {
console.error(
"No account specified. Please create a .a11yrc.json file or set subdomain, end_user_email and end_user_password as environment variables"
);
process.exit(1);
}
return account;
}
module.exports = getAccount;