Quote:
Originally Posted by BJN01
... I can't recover the host name.
|
Code:
getAllCrawledPackages().forEach(function(package) {
var hosts = [];
package.getDownloadLinks().forEach(function(link) {
var host = link.downloadHost;
if (hosts.indexOf(host) == -1) {
hosts.push(host);
}
})
if (hosts.length == 1) {
host = hosts[0];
if (host == "myhost.com") {
package.name = package.name.replace("old_string", "new_string");
}
}
})