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:
2025-08-12 05:02:42 +00:00
parent fcbe8151b7
commit 2f597d79df
11 changed files with 301 additions and 16 deletions

View File

@@ -171,8 +171,12 @@ async function downloadXRechnungRules(): Promise<void> {
console.log('3. Add XRechnung-specific TypeScript validators');
}
// Run the script
downloadXRechnungRules().catch(error => {
console.error('Failed to download XRechnung rules:', error);
process.exit(1);
});
// Run if executed directly
if (import.meta.url === `file://${process.argv[1]}`) {
downloadXRechnungRules().catch(error => {
console.error('Failed to download XRechnung rules:', error);
process.exit(1);
});
}
export default downloadXRechnungRules;