Skip to content

feat(config): add --yes/-y option to dk init for non-interactive overwrite#98

Merged
IT-WIBRC merged 1 commit intodevelopfrom
feat/skip-confirmation-option
Oct 5, 2025
Merged

feat(config): add --yes/-y option to dk init for non-interactive overwrite#98
IT-WIBRC merged 1 commit intodevelopfrom
feat/skip-confirmation-option

Conversation

@IT-WIBRC
Copy link
Owner

@IT-WIBRC IT-WIBRC commented Oct 5, 2025

Description

This PR introduces the --yes (or shorthand -y) option to the dk config init command.

Previously, attempting to run dk config init when a configuration file already existed required interactive confirmation from the user to overwrite the file.

With this change, users can now automate the initialization process and force the existing configuration file to be overwritten without being prompted, which is ideal for:

  1. Scripting and CI/CD: Running initialization commands non-interactively in automated environments.
  2. Quick Setup: Streamlining initial setup on a new machine where the configuration is guaranteed to be correct.

Key Changes

  • Non-Interactive Flag: The dk config init command now accepts --yes or -y.
  • Overwrite Logic: If the flag is present and a config file exists (local or global), the file is overwritten with the default configuration immediately.
  • Interactive Behavior: If the flag is not present, the existing interactive confirmation prompt is maintained.

This change is backward-compatible and classifies as a minor feature (feat) as it introduces new, non-breaking functionality.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing feature support current supported languages
  • Any dependent changes have been merged and published in downstream modules

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2025

Coverage Report for ./packages/devkit

Status Category Percentage Covered / Total
🟢 Lines 96.52% (🎯 85%) 3554 / 3682
🟢 Statements 96.52% (🎯 85%) 3554 / 3682
🟢 Functions 96.27% (🎯 90%) 155 / 161
🟢 Branches 92.77% (🎯 85%) 771 / 831
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/devkit/src/commands/init/index.ts 100% 100% 100% 100%
packages/devkit/src/commands/init/logic.ts 99.12% 89.47% 100% 99.12% 52
Generated in workflow #286 for commit 2dcfcae by the Vitest Coverage Report Action

Copy link
Owner Author

@IT-WIBRC IT-WIBRC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@IT-WIBRC IT-WIBRC merged commit a8a222e into develop Oct 5, 2025
2 checks passed
@github-actions github-actions bot deleted the feat/skip-confirmation-option branch October 5, 2025 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant