From f99747d27ae7154d5545e376c750a1e95a184f2c Mon Sep 17 00:00:00 2001 From: BIEBER Baptiste Date: Thu, 30 Aug 2018 17:46:37 +0200 Subject: [PATCH] Possibility to choose the number of space for the indentation --- README.md | 4 +++- index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe77fdf..5aaf905 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ $ sgp -h sgp({ 'src':'', // salesforce src directory path : ./src '40.0':'', // salesforce API verion : 40.0 - 'src':'' // salesforce src directory path : ./src + 'output':'', // salesforce src directory path : ./src + 'indent':' ' // the number of space for the xml indentation (optionnal attibute) }, console.log); ``` @@ -69,6 +70,7 @@ Add CLI parameters to build package.xml for only certain types ## Authors * **Sebastien Colladon** - *Initial work* - [scolladon](https://github.com/scolladon) +* **Baptiste Bieber** - *Add functionalities* - [baptistebieber](https://github.com/baptistebieber) ## License diff --git a/index.js b/index.js index 876dd95..c1c6476 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ module.exports = (config,logger) => { [].concat(...result).filter(elem => !!elem).forEach(elem => xml.importDocument(elem)); xml.ele('version') .t(config.apiVersion); - const xmlContent = xml.end({ pretty: true, indent: ' ', newline: '\n' }); + const xmlContent = xml.end({ pretty: true, indent: config.indent || ' ', newline: '\n' }); fs.writeFileSync(config.output + '/' + PACKAGE_XML_FILE_NAME, xmlContent); resolve(); }).catch(reject);