feat(postinstall): Add robust postinstall resource download with version checking
- Implemented version checking to avoid unnecessary re-downloads - Added retry logic with 3 attempts for network failures - Included network connectivity detection - Graceful error handling that never fails the install - Support for CI environment variable (EINVOICE_SKIP_RESOURCES) - Successfully tested all functionality including version checking and error handling
This commit is contained in:
@@ -57,8 +57,12 @@ async function main() {
|
||||
console.log('\n✅ Schematron download complete!');
|
||||
}
|
||||
|
||||
// Run the script
|
||||
main().catch(error => {
|
||||
console.error('❌ Script failed:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
// Run if executed directly
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
main().catch(error => {
|
||||
console.error('❌ Script failed:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
export default main;
|
Reference in New Issue
Block a user