Add PACKAGE_JSON_INDENT setting
Allow custom number of indent spaces when regenerating package.json
This commit is contained in:
parent
a8769079be
commit
238f99838a
3 changed files with 3 additions and 1 deletions
|
@ -56,6 +56,7 @@ module.exports = {
|
||||||
SHORT: 'CUSTOM',
|
SHORT: 'CUSTOM',
|
||||||
SILENT: false,
|
SILENT: false,
|
||||||
PACKAGE_JSON_PATH: './package.json',
|
PACKAGE_JSON_PATH: './package.json',
|
||||||
|
PACKAGE_JSON_INDENT: 4,
|
||||||
components: {
|
components: {
|
||||||
AutoIncreaseVersion: true,
|
AutoIncreaseVersion: true,
|
||||||
InjectAsComment: true,
|
InjectAsComment: true,
|
||||||
|
|
|
@ -91,7 +91,7 @@ export default class AutoIncreaseVersion {
|
||||||
this.packageFile.version = newVersion;
|
this.packageFile.version = newVersion;
|
||||||
fs.writeFile(
|
fs.writeFile(
|
||||||
path.resolve(this.context.config.PACKAGE_JSON_PATH),
|
path.resolve(this.context.config.PACKAGE_JSON_PATH),
|
||||||
JSON.stringify(this.packageFile, null, 4), (err) => {
|
JSON.stringify(this.packageFile, null, this.context.config.PACKAGE_JSON_INDENT), (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.reject(err);
|
this.reject(err);
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
|
@ -2,6 +2,7 @@ export default {
|
||||||
SHORT: 'AIV_SHORT',
|
SHORT: 'AIV_SHORT',
|
||||||
SILENT: false,
|
SILENT: false,
|
||||||
PACKAGE_JSON_PATH: './package.json',
|
PACKAGE_JSON_PATH: './package.json',
|
||||||
|
PACKAGE_JSON_INDENT: 4,
|
||||||
components: {
|
components: {
|
||||||
AutoIncreaseVersion: true,
|
AutoIncreaseVersion: true,
|
||||||
InjectAsComment: true,
|
InjectAsComment: true,
|
||||||
|
|
Loading…
Reference in a new issue