feross / hostile

Simple, programmatic `/etc/hosts` manipulation (in node.js)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug adding hosts to host file

Saturate opened this issue · comments

Hello,

I'm trying to add some host like this:

project.hosts.forEach(function (mapping) {
    hostile.set(mapping.ip, mapping.hostname, function (err) {
        if (err) {
            console.error(err)
        } else {
            console.log('Successfully added:', mapping.ip, mapping.hostname);
        }
    });
});

It outputs:

[09:01:27] Starting 'apply-hosts'...
Successfully added: 127.0.0.1 brian.example.com
Successfully added: 127.0.0.1 allan.example.com

but only brian.example.comis added to the host file. I'm running windows 8.1.

Duplicate of #9.