@@ -4,6 +4,7 @@ import _ = require('lodash');
44import { relative } from 'path' ;
55import semver = require( 'semver' ) ;
66import {
7+ OPTION_INDENT ,
78 OPTION_SEMVER_RANGE ,
89 OPTION_SOURCES ,
910 OPTIONS_DEV ,
@@ -14,6 +15,7 @@ import {
1415} from './constants' ;
1516import { collect } from './lib/collect' ;
1617import { getDependencyTypes } from './lib/get-dependency-types' ;
18+ import { getIndent } from './lib/get-indent' ;
1719import { getPackages } from './lib/get-packages' ;
1820import { getVersionNumber } from './lib/version' ;
1921import { CommanderApi } from './typings' ;
@@ -25,13 +27,15 @@ export const run = async (program: CommanderApi) => {
2527 . option ( OPTIONS_PROD . spec , OPTIONS_PROD . description )
2628 . option ( OPTIONS_DEV . spec , OPTIONS_DEV . description )
2729 . option ( OPTIONS_PEER . spec , OPTIONS_PEER . description )
30+ . option ( OPTION_INDENT . spec , OPTION_INDENT . description )
2831 . parse ( process . argv ) ;
2932
3033 const semverRange : string =
3134 program . semverRange || OPTION_SEMVER_RANGE . default ;
3235
33- const dependencyTypes = getDependencyTypes ( program ) ;
3436 const pkgs = await getPackages ( program ) ;
37+ const dependencyTypes = getDependencyTypes ( program ) ;
38+ const indent = getIndent ( program ) ;
3539
3640 _ ( pkgs ) . each ( ( pkg ) =>
3741 _ ( dependencyTypes )
@@ -61,7 +65,7 @@ export const run = async (program: CommanderApi) => {
6165 ) ;
6266
6367 await Promise . all (
64- pkgs . map ( ( { data, path } ) => writeJson ( path , data , { spaces : 2 } ) )
68+ pkgs . map ( ( { data, path } ) => writeJson ( path , data , { spaces : indent } ) )
6569 ) ;
6670
6771 _ . each ( pkgs , ( pkg ) => {
0 commit comments