bin/commands/install.js
function (module_name, module_folder) {
    var module_path = path.resolve(module_folder);

    // load current keystore
    let keystored = {};
    const filename = ".iotdb/keystore.json";
    _.cfg.load.json([ filename ], docd => keystored = _.d.compose.deep(keystored, docd.doc));

    // change it
    _.d.set(keystored, "/modules/" + module_name, module_path)

    // save it
    fs.writeFile(filename, JSON.stringify(keystored, null, 2));

    console.log("- installed homestar module!");
    console.log("  name:", module_name);
    console.log("  path:", module_path);
}
function (module_name, module_folder) {
    var module_path = path.resolve(module_folder);

    // load current keystore
    let keystored = {};
    const filename = ".iotdb/keystore.json";
    _.cfg.load.json([ filename ], docd => keystored = _.d.compose.deep(keystored, docd.doc));

    // change it
    _.d.set(keystored, "/modules/" + module_name, module_path)

    // save it
    fs.writeFile(filename, JSON.stringify(keystored, null, 2));

    console.log("- installed homestar module!");
    console.log("  name:", module_name);
    console.log("  path:", module_path);
}
function ( module_name , module_folder ) { var module_path = path . resolve ( module_folder ) ; // load current keystore let keystored = { } ; const filename = ".iotdb/keystore.json" ; _ . cfg . load . json ( [ filename ] , docd => keystored = _ . d . compose . deep ( keystored , docd . doc ) ) ; // change it _ . d . set ( keystored , "/modules/" + module_name , module_path ) // save it fs . writeFile ( filename , JSON . stringify ( keystored , null , 2 ) ) ; console . log ( "- installed homestar module!" ) ; console . log ( "  name:" , module_name ) ; console . log ( "  path:" , module_path ) ; }
Add module info to the keystore
Add module info to the keystore