You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/packages/hydrooj/bin/hydrooj.js

20 lines
649 B
JavaScript

4 years ago
#!/usr/bin/env node
require('@hydrooj/utils/lib/register');
4 years ago
const { default: hook } = require('require-resolve-hook');
const { bypass } = hook(/^(hydrooj|@hydrooj\/utils|cordis|schemastery|lodash|js-yaml)/, (id) => {
if (id.startsWith('hydrooj/src')) {
console.log('module require via %s is deprecated.', id);
if (process.env.DEV) {
console.log(
new Error().stack.split('\n')
.filter((i) => !i.includes('node:internal') && i.startsWith(' '))
.join('\n'),
);
}
}
return bypass(() => require.resolve(id));
});
require('./commands');