Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't overwrite existing ahoy.yml on init #4

Closed
bjeavons opened this issue Nov 4, 2015 · 3 comments
Closed

Don't overwrite existing ahoy.yml on init #4

bjeavons opened this issue Nov 4, 2015 · 3 comments
Assignees

Comments

@bjeavons
Copy link

bjeavons commented Nov 4, 2015

init should check for an existing .ahoy.yml file and prompt for overwrite before doing so.

@frankcarey
Copy link
Contributor

This is a good idea, or at least have it check first, but you can actually update this yourself. If you implement an "init" command in .ahoy.yml, you can have it do (or not do) anything you want to.

Example:

commands:
  init:
    cmd: echo "These aren't the droids you're looking for.."
    usage: Don't do anything
commands:
  init:
    cmd: ls .ahoy.yml || wget $MY_INIT_FILE -O ./.ahoy.yml
    usage: Download my own init file from elsewhere, but only if a local one doesn't exist.

We should at least add that to the examples for now.

@AlexSkrypnyk
Copy link
Collaborator

This issue is still present in Ahoy 2 - running ahoy init on the project with existing .ahoy.yml silently overrides it. Having a prompt would be helpful.

ocean referenced this issue in ocean/ahoy Jul 17, 2022
Shows a warning and a confirmation prompt when running `ahoy init`
if an `.ahoy.yml` file already exists in the current directory and
would otherwise be overwritten.

BREAKING CHANGE: The warning prompt requires user input, so this may
require updating of e.g. scripted calls to `ahoy init`. The prompt
can be overruled by passing the "force" flag, e.g.
`ahoy init --force`
@ocean ocean self-assigned this Jul 17, 2022
ocean added a commit that referenced this issue Jul 25, 2022
fix!: [#4] Show overwrite warning for `ahoy init`
@ocean
Copy link
Collaborator

ocean commented Jan 6, 2023

Closing as this is fixed with #97

@ocean ocean closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants