26 lines
604 B
JavaScript
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);
|
|
}); |