Files
ior-resolver/lib/fetch-remote-component.js
Chris Daßler e1fb6e6acc Initial commit
2025-08-29 04:22:52 +02:00

26 lines
604 B
JavaScript

// Suppress console.log from the resolver during fetching
const originalLog = console.log;
console.log = () => {};
const { fetchRemoteComponent } = require('./metro-ior-resolver.js');
// Restore console.log for our output
console.log = originalLog;
const ior = process.argv[2];
if (!ior) {
console.error('No IOR provided');
process.exit(1);
}
fetchRemoteComponent(ior)
.then(path => {
// Output only the path on stdout
console.log(path);
process.exit(0);
})
.catch(err => {
// Output error to stderr
console.error('FETCH_ERROR:', err.message);
process.exit(1);
});