bin/wafr.js
function writeContractsFile(contractsFilePath, contractsObject, callback) { // eslint-disable-line
  if (typeof contractsFilePath !== 'string') {
    return callback();
  }

  if (utils.filenameExtension(contractsFilePath) !== 'json') {
    throw new Error('Your contracts output file must be a JSON file (i.e. --output ./contracts.json)');
  }

  fs.writeFile(path.resolve(contractsFilePath), JSON.stringify(contractsObject), (writeContractsFileError) => {
    if (writeContractsFileError) {
      throw new Error(`while writting output JSON file ${contractsFilePath}: ${writeContractsFileError}`);
    }

    callback();
  });
}
function writeContractsFile(contractsFilePath, contractsObject, callback) { // eslint-disable-line
  if (typeof contractsFilePath !== 'string') {
    return callback();
  }

  if (utils.filenameExtension(contractsFilePath) !== 'json') {
    throw new Error('Your contracts output file must be a JSON file (i.e. --output ./contracts.json)');
  }

  fs.writeFile(path.resolve(contractsFilePath), JSON.stringify(contractsObject), (writeContractsFileError) => {
    if (writeContractsFileError) {
      throw new Error(`while writting output JSON file ${contractsFilePath}: ${writeContractsFileError}`);
    }

    callback();
  });
}
function writeContractsFile ( contractsFilePath , contractsObject , callback ) { // eslint-disable-line if ( typeof contractsFilePath !== 'string' ) { return callback ( ) ; } if ( utils . filenameExtension ( contractsFilePath ) !== 'json' ) { throw new Error ( 'Your contracts output file must be a JSON file (i.e. --output ./contracts.json)' ) ; } fs . writeFile ( path . resolve ( contractsFilePath ) , JSON . stringify ( contractsObject ) , ( writeContractsFileError ) => { if ( writeContractsFileError ) { throw new Error ( ` ${ contractsFilePath } ${ writeContractsFileError } ` ) ; } callback ( ) ; } ) ; }
write contracts file
write contracts file