33 lines
837 B
JavaScript
33 lines
837 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Test hook script for core config generation (Node.js version)
|
|
* This script will be executed after the configuration is generated.
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function main() {
|
|
if (process.argv.length < 3) {
|
|
console.error('Error: No config file path provided');
|
|
process.exit(1);
|
|
}
|
|
|
|
const configPath = process.argv[2];
|
|
|
|
if (!fs.existsSync(configPath)) {
|
|
console.error(`Error: Config file not found: ${configPath}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
const stats = fs.statSync(configPath);
|
|
console.log(`Node.js hook executed successfully! Config file: ${configPath}`);
|
|
console.log(`File size: ${stats.size} bytes`);
|
|
|
|
// You can add custom processing here
|
|
process.exit(0);
|
|
}
|
|
|
|
if (require.main === module) {
|
|
main();
|
|
} |