Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 11 additions and 9 deletions
Showing only changes of commit 7e58ac40aa - Show all commits

View File

@ -83,24 +83,26 @@ class Wifi {
*/
_readConfigCb (err, data) {
let parsed
let current
if (err) {
console.error(err)
return _cb(err)
}
console.log(data)
parsed = parseConfig(data)
console.dir(parsed)
console.log(data)
console.log(data.search(networkPattern))
console.log(_entry)
if (data.search(networkPattern) === -1) {
data += `\n${_entry}`
current = parsed.filter(network => {
return (network.ssid + '').toLowerCase() === (_ssid + '').toLowerCase()
})
console.log(current)
if (typeof current !== 'undefined') {
data = data.replace(current.raw, _entry)
} else {
data = data.replace(networkPattern, _entry)
data += '\n\n' + _entry
}
console.dir(data)
console.log(data)
_entry = null
this._writeConfigCb(null)
//fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
}
/**