Push dev work to master #2
|
@ -88,22 +88,17 @@ class Wifi {
|
|||
console.error(err)
|
||||
return _cb(err)
|
||||
}
|
||||
console.log(data)
|
||||
parsed = parseConfig(data)
|
||||
console.dir(parsed)
|
||||
current = parsed.find(network => {
|
||||
return network.ssid === _ssid
|
||||
})
|
||||
console.log(current)
|
||||
if (typeof current !== 'undefined') {
|
||||
data = data.replace(current.raw, _entry)
|
||||
} else {
|
||||
data += '\n\n' + _entry
|
||||
}
|
||||
console.log(data)
|
||||
_entry = null
|
||||
setTimeout(this._writeConfigCb, 1)
|
||||
//fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
|
||||
fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
|
||||
}
|
||||
/**
|
||||
* (internal function) Invoked after config file is written,
|
||||
|
|
Loading…
Reference in New Issue