mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-17 16:53:13 +00:00
Updated import/export for RecoveryModule
This commit is contained in:
@@ -110,10 +110,10 @@ if (process.argv.length > 1)
|
|||||||
process.exit();
|
process.exit();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
if (process.argv[2] == 'CoreModule')
|
if (process.argv[2] == 'CoreModule' || process.argv[2] == 'RecoveryModule')
|
||||||
{
|
{
|
||||||
db.target = require('fs').createWriteStream('CoreModule.js', { flags: 'wb' });
|
db.target = require('fs').createWriteStream(process.argv[2]+'.js', { flags: 'wb' });
|
||||||
db.target.write(db.GetBuffer(process.argv[2]).slice(4), function () { console.log('finished exporting'); process.exit(); });
|
db.target.write(db.GetBuffer('CoreModule').slice(4), function () { console.log('finished exporting'); process.exit(); });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -122,12 +122,12 @@ if (process.argv.length > 1)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'import':
|
case 'import':
|
||||||
if (process.argv[2] == 'CoreModule')
|
if (process.argv[2] == 'CoreModule' || process.argv[2] == 'RecoveryModule')
|
||||||
{
|
{
|
||||||
var src = require('fs').readFileSync('CoreModule.js', 'rb');
|
var src = require('fs').readFileSync(process.argv[2] + '.js', 'rb');
|
||||||
var src2 = Buffer.concat([Buffer.alloc(4), src]);
|
var src2 = Buffer.concat([Buffer.alloc(4), src]);
|
||||||
db.Put(process.argv[2], src2);
|
db.Put('CoreModule', src2);
|
||||||
console.log('CoreModule imported');
|
console.log(process.argv[2] + ' imported');
|
||||||
}
|
}
|
||||||
process.exit();
|
process.exit();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user