Skip to content

Commit

Permalink
chore: Fix clean sub-commands for iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
angelmadames committed Jun 17, 2024
1 parent 6adcc9d commit 176fc43
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
14 changes: 4 additions & 10 deletions src/commands/clean/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ export function cleanAllCommand() {
.action(async (options) => {
logger.info('Cleaning all local dependencies for managed apps...')

const flags = ['']
if (options.force) {
logger.warn('User interactivity disabled due to --force flag.')
flags.push('--force')
}

cleanComposeServicesCommand().parse(flags)
await cleanDepsCommand().parseAsync(flags)
await cleanDotEnvCommand().parseAsync(flags)
await cleanReposCommand().parseAsync(flags)
cleanComposeServicesCommand().parse()
await cleanDepsCommand().parseAsync()
await cleanDotEnvCommand().parseAsync()
await cleanReposCommand().parseAsync()

logger.info('Cleanup of everything completed.')
})
Expand Down
2 changes: 1 addition & 1 deletion src/commands/clean/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function cleanDepsCommand() {
logger.warn('User interactivity disabled due to --force flag.')
}

for (const repoPath in projectConfig.reposPaths()) {
for (const repoPath of projectConfig.reposPaths()) {
await deletePath({
path: repoPath,
force: options.force,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/clean/dot-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function cleanDotEnvCommand() {
logger.warn('User interactivity disabled due to --force flag.')
}

for (const repoPath in projectConfig.reposPaths()) {
for (const repoPath of projectConfig.reposPaths()) {
await deletePath({
path: join(repoPath, '.env'),
force: options.force,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/clean/repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function cleanReposCommand() {
logger.warn(` - ${repo}`)
}

for (const repoPath in projectConfig.reposPaths()) {
for (const repoPath of projectConfig.reposPaths()) {
await deletePath({
path: repoPath,
force: options.force,
Expand Down

0 comments on commit 176fc43

Please sign in to comment.