tools/setup/file_manager.js
function() {
    const oThis = this;

    // Remove old setup folder
    logger.info("* Deleting old openST setup folder");
    oThis.rm('');

    // Create new setup folder
    logger.info("* Creating new openST setup folder");
    oThis.mkdir('');

    // Create logs setup folder
    logger.info("* Creating openST setup logs folder");
    oThis.mkdir(setupHelper.logsFolder());

    // Create intercom data files in logs folder
    logger.info("* Creating openST intercom data files");
    const intercomProcessIdentifiers = setupHelper.intercomProcessIdentifiers();
    for (var i=0; i < intercomProcessIdentifiers.length; i++) {
      oThis.touch('logs/' + intercomProcessIdentifiers[i] + '.data', "{\\\"lastProcessedBlock\\\":0,\\\"lastProcessedTransactionIndex\\\":0}");
    }

    // Create bin setup folder
    logger.info("* Creating openST setup bin folder");
    oThis.mkdir(setupHelper.binFolder());

    // Create empty ENV file
    logger.info("* Create empty ENV file");
    oThis.touch(setupConfig.env_vars_file, '#!/bin/sh');
  }
function() {
    const oThis = this;

    // Remove old setup folder
    logger.info("* Deleting old openST setup folder");
    oThis.rm('');

    // Create new setup folder
    logger.info("* Creating new openST setup folder");
    oThis.mkdir('');

    // Create logs setup folder
    logger.info("* Creating openST setup logs folder");
    oThis.mkdir(setupHelper.logsFolder());

    // Create intercom data files in logs folder
    logger.info("* Creating openST intercom data files");
    const intercomProcessIdentifiers = setupHelper.intercomProcessIdentifiers();
    for (var i=0; i < intercomProcessIdentifiers.length; i++) {
      oThis.touch('logs/' + intercomProcessIdentifiers[i] + '.data', "{\\\"lastProcessedBlock\\\":0,\\\"lastProcessedTransactionIndex\\\":0}");
    }

    // Create bin setup folder
    logger.info("* Creating openST setup bin folder");
    oThis.mkdir(setupHelper.binFolder());

    // Create empty ENV file
    logger.info("* Create empty ENV file");
    oThis.touch(setupConfig.env_vars_file, '#!/bin/sh');
  }
function ( ) { const oThis = this ; // Remove old setup folder logger . info ( "* Deleting old openST setup folder" ) ; oThis . rm ( '' ) ; // Create new setup folder logger . info ( "* Creating new openST setup folder" ) ; oThis . mkdir ( '' ) ; // Create logs setup folder logger . info ( "* Creating openST setup logs folder" ) ; oThis . mkdir ( setupHelper . logsFolder ( ) ) ; // Create intercom data files in logs folder logger . info ( "* Creating openST intercom data files" ) ; const intercomProcessIdentifiers = setupHelper . intercomProcessIdentifiers ( ) ; for ( var i = 0 ; i < intercomProcessIdentifiers . length ; i ++ ) { oThis . touch ( 'logs/' + intercomProcessIdentifiers [ i ] + '.data' , "{\\\"lastProcessedBlock\\\":0,\\\"lastProcessedTransactionIndex\\\":0}" ) ; } // Create bin setup folder logger . info ( "* Creating openST setup bin folder" ) ; oThis . mkdir ( setupHelper . binFolder ( ) ) ; // Create empty ENV file logger . info ( "* Create empty ENV file" ) ; oThis . touch ( setupConfig . env_vars_file , '#!/bin/sh' ) ; }
Do the old setup clean up
Do the old setup clean up