@@ -47,7 +47,7 @@ function bytesToHumanReadable(bytes: number): string {
4747function promiseMap < T > (
4848 values : T [ ] ,
4949 mapper : ( value : T ) => Promise < void > ,
50- concurrency = 10
50+ concurrency = 10 ,
5151) {
5252 let index = 0 ;
5353 let pending = 0 ;
@@ -89,7 +89,7 @@ export class CleanCommand implements ICommand {
8989 private $logger : ILogger ,
9090 private $options : IOptions ,
9191 private $childProcess : IChildProcess ,
92- private $staticConfig : IStaticConfig
92+ private $staticConfig : IStaticConfig ,
9393 ) { }
9494
9595 public async execute ( args : string [ ] ) : Promise < void > {
@@ -117,7 +117,7 @@ export class CleanCommand implements ICommand {
117117 const overridePathsToClean =
118118 this . $projectConfigService . getValue ( "cli.pathsToClean" ) ;
119119 const additionalPaths = this . $projectConfigService . getValue (
120- "cli.additionalPathsToClean"
120+ "cli.additionalPathsToClean" ,
121121 ) ;
122122
123123 // allow overriding default paths to clean
@@ -147,8 +147,8 @@ export class CleanCommand implements ICommand {
147147 stats : Object . fromEntries ( res . stats . entries ( ) ) ,
148148 } ,
149149 null ,
150- 2
151- )
150+ 2 ,
151+ ) ,
152152 ) ;
153153
154154 return ;
@@ -169,7 +169,7 @@ export class CleanCommand implements ICommand {
169169 }
170170
171171 const shouldScan = await this . $prompter . confirm (
172- "No project found in the current directory. Would you like to scan for all projects in sub-directories instead?"
172+ "No project found in the current directory. Would you like to scan for all projects in sub-directories instead?" ,
173173 ) ;
174174
175175 if ( ! shouldScan ) {
@@ -184,7 +184,7 @@ export class CleanCommand implements ICommand {
184184 const updateProgress = ( ) => {
185185 const current = color . grey ( `${ computed } /${ paths . length } ` ) ;
186186 spinner . start (
187- `Gathering cleanable sizes. This may take a while... ${ current } `
187+ `Gathering cleanable sizes. This may take a while... ${ current } ` ,
188188 ) ;
189189 } ;
190190
@@ -201,7 +201,7 @@ export class CleanCommand implements ICommand {
201201 `node ${ this . $staticConfig . cliBinPath } clean --dry-run --json --disable-analytics` ,
202202 {
203203 cwd : p ,
204- }
204+ } ,
205205 )
206206 . then ( ( res ) => {
207207 const paths : Record < string , number > = JSON . parse ( res ) . stats ;
@@ -211,7 +211,7 @@ export class CleanCommand implements ICommand {
211211 this . $logger . trace (
212212 "Failed to get project size for %s, Error is:" ,
213213 p ,
214- err
214+ err ,
215215 ) ;
216216 return - 1 ;
217217 } )
@@ -225,7 +225,7 @@ export class CleanCommand implements ICommand {
225225 updateProgress ( ) ;
226226 } ) ;
227227 } ,
228- os . cpus ( ) . length
228+ os . cpus ( ) . length ,
229229 ) ;
230230
231231 spinner . clear ( ) ;
@@ -241,7 +241,7 @@ export class CleanCommand implements ICommand {
241241 `Found ${
242242 projects . size
243243 } cleanable project(s) with a total size of: ${ color . green (
244- bytesToHumanReadable ( totalSize )
244+ bytesToHumanReadable ( totalSize ) ,
245245 ) } . Select projects to clean`,
246246 Array . from ( projects . keys ( ) ) . map ( ( p ) => {
247247 const size = projects . get ( p ) ;
@@ -260,21 +260,21 @@ export class CleanCommand implements ICommand {
260260 true ,
261261 {
262262 optionsPerPage : process . stdout . rows - 6 , // 6 lines are taken up by the instructions
263- } as Partial < PromptObject >
263+ } as Partial < PromptObject > ,
264264 ) ;
265265 this . $logger . clearScreen ( ) ;
266266
267267 spinner . warn (
268268 `This will run "${ color . yellow (
269- `ns clean`
269+ `ns clean` ,
270270 ) } " in all the selected projects and ${ color . red . bold (
271- "delete files from your system"
272- ) } !`
271+ "delete files from your system" ,
272+ ) } !`,
273273 ) ;
274274 spinner . warn ( `This action cannot be undone!` ) ;
275275
276276 let confirmed = await this . $prompter . confirm (
277- "Are you sure you want to clean the selected projects?"
277+ "Are you sure you want to clean the selected projects?" ,
278278 ) ;
279279 if ( ! confirmed ) {
280280 return ;
@@ -287,7 +287,7 @@ export class CleanCommand implements ICommand {
287287 const currentPath = pathsToClean [ i ] ;
288288
289289 spinner . start (
290- `Cleaning ${ color . cyan ( currentPath ) } ... ${ i + 1 } /${ pathsToClean . length } `
290+ `Cleaning ${ color . cyan ( currentPath ) } ... ${ i + 1 } /${ pathsToClean . length } ` ,
291291 ) ;
292292
293293 const ok = await this . $childProcess
@@ -297,7 +297,7 @@ export class CleanCommand implements ICommand {
297297 } --json --disable-analytics`,
298298 {
299299 cwd : currentPath ,
300- }
300+ } ,
301301 )
302302 . then ( ( res ) => {
303303 const cleanupRes = JSON . parse ( res ) as IProjectCleanupResult ;
@@ -311,7 +311,7 @@ export class CleanCommand implements ICommand {
311311 if ( ok ) {
312312 const cleanedSize = projects . get ( currentPath ) ;
313313 const cleanedSizeStr = color . grey (
314- `- ${ bytesToHumanReadable ( cleanedSize ) } `
314+ `- ${ bytesToHumanReadable ( cleanedSize ) } ` ,
315315 ) ;
316316 spinner . succeed ( `Cleaned ${ color . cyan ( currentPath ) } ${ cleanedSizeStr } ` ) ;
317317 totalSizeCleaned += cleanedSize ;
@@ -323,19 +323,19 @@ export class CleanCommand implements ICommand {
323323 spinner . stop ( ) ;
324324 spinner . succeed (
325325 `Done! We've just freed up ${ color . green (
326- bytesToHumanReadable ( totalSizeCleaned )
327- ) } ! Woohoo! 🎉`
326+ bytesToHumanReadable ( totalSizeCleaned ) ,
327+ ) } ! Woohoo! 🎉`,
328328 ) ;
329329
330330 if ( this . $options . dryRun ) {
331331 spinner . info (
332- 'Note: the "--dry-run" flag was used, so no files were actually deleted.'
332+ 'Note: the "--dry-run" flag was used, so no files were actually deleted.' ,
333333 ) ;
334334 }
335335 }
336336
337337 private async getNSProjectPathsInDirectory (
338- dir = process . cwd ( )
338+ dir = process . cwd ( ) ,
339339 ) : Promise < string [ ] > {
340340 let nsDirs : string [ ] = [ ] ;
341341
@@ -346,20 +346,20 @@ export class CleanCommand implements ICommand {
346346 }
347347
348348 const dirents = await readdir ( dir , { withFileTypes : true } ) . catch (
349- ( err ) => {
349+ ( err ) : any [ ] => {
350350 this . $logger . trace (
351351 'Failed to read directory "%s". Error is:' ,
352352 dir ,
353- err
353+ err ,
354354 ) ;
355355 return [ ] ;
356- }
356+ } ,
357357 ) ;
358358
359359 const hasNSConfig = dirents . some (
360360 ( ent ) =>
361361 ent . name . includes ( "nativescript.config.ts" ) ||
362- ent . name . includes ( "nativescript.config.js" )
362+ ent . name . includes ( "nativescript.config.js" ) ,
363363 ) ;
364364
365365 if ( hasNSConfig ) {
@@ -375,7 +375,7 @@ export class CleanCommand implements ICommand {
375375 if ( dirent . isDirectory ( ) ) {
376376 return getFiles ( res ) ;
377377 }
378- } )
378+ } ) ,
379379 ) ;
380380 } ;
381381
0 commit comments