Skip to content
Open
32 changes: 31 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"notifications-node-client": "^7.0.3",
"nunjucks": "^3.2.4",
"p-map": "^7.0.3",
"pdf.js-extract": "^0.2.1",
"pino": "^8.1.0",
"pino-http": "^8.1.0",
"pino-pretty": "^8.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"dependencies": {
"@azure/identity": "*",
"@azure/keyvault-secrets": "*"
"@azure/keyvault-secrets": "*",
"pdf.js-extract": "*"
}
}
42 changes: 42 additions & 0 deletions packages/scripts/run/exam-library-checker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { examLibraryChecker } from '../src/exam-library-checker.js';

// Parse command line arguments
const [, , caseReference, targetEnv] = process.argv;
const validEnvironments = ['DEV', 'TEST', 'PROD'];
const args = process.argv.slice(2);
const doRedirectTest = args.includes('-doRedirectTest') ? true : false;
const doBlobStoreTest = args.includes('-doBlobStoreTest') ? true : false;
const doCheckLinksWithoutRemapping = args.includes('-doCheckLinksWithoutRemapping') ? true : false;

// =====================================================
// This script is to be run in the LOCAL DEV environment
// =====================================================

if (!caseReference || !targetEnv) {
console.error(
'Usage: node exam-library-checker.js <caseReference> <targetEnv (DEV|TEST|PROD)> <-doRedirectTest> <-doBlobStoreTest> <-doCheckLinksWithoutRemapping>'
);
process.exit(1);
}

if (!validEnvironments.includes(targetEnv)) {
console.error(
`Invalid target environment: ${targetEnv}. Valid options are: ${validEnvironments.join(', ')}`
);

process.exit(1);
}

examLibraryChecker(
caseReference,
targetEnv,
doRedirectTest,
doBlobStoreTest,
doCheckLinksWithoutRemapping
)
.then(() => {
console.log('Successfully checked the examination library doc links');
})
.catch((error) => {
console.error(error);
});
Loading