Skip to content

Commit

Permalink
Add option to include/exclude managed package. Fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
gavignon committed Nov 26, 2017
1 parent 9b522fd commit 7c5c05b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules/
files/**/*.json
files/**/*.log
1 change: 1 addition & 0 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down Expand Up @@ -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);
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 7c5c05b

Please sign in to comment.