diff --git a/.gitignore b/.gitignore index 14d77df..f496115 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store node_modules/ files/**/*.json +files/**/*.log diff --git a/bin/cli b/bin/cli index 39a73a8..1467698 100755 --- a/bin/cli +++ b/bin/cli @@ -14,6 +14,7 @@ program .option('-c, --customObjects [customObjects]', 'retrieve all custom objects [true]', true) .option('-s, --standardObjects [standardObjects]', 'standard sObjects to retrieve separated with commas') .option('-D, --debug [debug]', 'generate debug log file [false]', false) + .option('-e, --excludeManagedPackage [excludeManagedPackage]', 'exclude managed packaged [true]', true) .option('-d, --deleteFolders [deleteFolders]', 'delete/clean temp folders [true]', true) .option('-o, --output [dir]', 'salesforce data dictionary directory path [.]', '.') .parse(process.argv); diff --git a/index.js b/index.js index be07d18..8d0aa81 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,9 @@ module.exports = (config, logger) => { if (typeof config.debug === 'undefined' || config.debug === null) { config.debug = false; } + if (typeof config.excludeManagedPackage === 'undefined' || config.excludeManagedPackage === null) { + config.excludeManagedPackage = true; + } if (typeof config.projectName === 'undefined' || config.projectName === null) { config.projectName = 'PROJECT'; } @@ -92,8 +95,14 @@ module.exports = (config, logger) => { config.objects = []; // If the sObject is a real custom object - if (object.custom && (object.name.indexOf('__c') !== -1) && (object.name.split('__').length - 1 < 2)) - config.objects.push(object.name); + if (object.custom && (object.name.indexOf('__c') !== -1)){ + if(config.excludeManagedPackage){ + if((object.name.split('__').length - 1 < 2)) + config.objects.push(object.name); + }else{ + config.objects.push(object.name); + } + } } diff --git a/package.json b/package.json index 6bba6cf..8722b71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sfdc-generate-data-dictionary", - "version": "1.0.3", + "version": "1.0.4", "description": "Generate data dictionary from a Salesforce Org", "main": "index.js", "bin": {