Merge pull request #15 from baptistebieber/master
Possibility to choose the number of space for the indentation
This commit is contained in:
Коммит
e0ad563c6f
|
@ -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
|
||||
|
||||
|
|
4
index.js
4
index.js
|
@ -29,10 +29,10 @@ 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);
|
||||
});
|
||||
return promise;
|
||||
};
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче