function read_sw_eeprom(callback) { var uuid = execSync.exec('dmidecode -s system-uuid'); var uuid_eeprom = uuid_eeprom_path + uuid.stdout.toString().trim() + ".json"; fs.exists(uuid_eeprom, function(exists) { if (!exists) { //read eeprom.json and build the uuid eeprom, then delete the eeprom.json fs.rename(eeprom_dot_json, uuid_eeprom, function(err, suc) { if (err) { console.log("Error: %s OR %s does not exist. Is this a new virtual_relay or a clonded virtual relay? Request a eeprom.json from \"Walt\"--> to be replaced with http://developer.wigwag.com or whatever", uuid_eeprom, eeprom_dot_json); callback("no_eeprom", null); } else { eeprom2relay(uuid_eeprom, callback); } }); } else { eeprom2relay(uuid_eeprom, callback); } }); }
afterEach(() => { process.chdir.restore(); globby.sync.restore(); childProcess.execSync.restore(); });
const execSync = function() { return cp.execSync.apply(this, arguments).toString(); };