Initial commit with Python .gitignore
This commit is contained in:
33
scientific_surfing/templates/hooks/core_config_generated.js
Normal file
33
scientific_surfing/templates/hooks/core_config_generated.js
Normal file
@ -0,0 +1,33 @@
|
||||
#!/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();
|
||||
}
|
||||
31
scientific_surfing/templates/hooks/core_config_generated.py
Normal file
31
scientific_surfing/templates/hooks/core_config_generated.py
Normal file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test hook script for core config generation.
|
||||
This script will be executed after the configuration is generated.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Error: No config file path provided")
|
||||
sys.exit(1)
|
||||
|
||||
config_path = Path(sys.argv[1])
|
||||
|
||||
if not config_path.exists():
|
||||
print(f"Error: Config file not found: {config_path}")
|
||||
sys.exit(1)
|
||||
|
||||
print(f"Hook executed successfully! Config file: {config_path}")
|
||||
print(f"File size: {config_path.stat().st_size} bytes")
|
||||
|
||||
# You can add custom processing here
|
||||
# For example, copy the file to another location, modify it, etc.
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user