Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Avoid override existing delivery configuration #1162

Merged
merged 2 commits into from
Feb 14, 2017

Conversation

afiune
Copy link
Contributor

@afiune afiune commented Feb 8, 2017

Description

Before this change if a user ran chef generate build-cookbook . on a
delivery project that has already a project.toml and/or config.json
both files would get overwritten.

This change fixes this problem by adding a not_if guard.

Signed-off-by: Salim Afiune afiune@chef.io

Issues Resolved

COOL-653 / ZD 10945

Check List

source "delivery-config.json"
not_if {File.exist?(config_json)}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: property style here is not_if { File.exist?(config_json) } (mostly for readability)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on it! 👍

@afiune afiune force-pushed the afiune/COOL-653/do-not-override-config.json branch 4 times, most recently from 29aa53c to 3c5b1ed Compare February 8, 2017 22:09
Salim Afiune added 2 commits February 8, 2017 17:14
Before this change if a user ran `chef generate build-cookbook .` on a
delivery project that has already a `project.toml` and/or `config.json`
both files would get overwritten.

This change fixes this problem by adding a `not_if` guard.

Signed-off-by: Salim Afiune <afiune@chef.io>
Signed-off-by: Salim Afiune <afiune@chef.io>
@afiune afiune force-pushed the afiune/COOL-653/do-not-override-config.json branch from 3c5b1ed to 7b76e44 Compare February 8, 2017 22:15
@afiune
Copy link
Contributor Author

afiune commented Feb 13, 2017

pinging @chef/maintainers

@afiune afiune merged commit 84e6160 into master Feb 14, 2017
@afiune afiune deleted the afiune/COOL-653/do-not-override-config.json branch February 14, 2017 13:39
@afiune afiune self-assigned this Feb 16, 2017
@afiune afiune added the Type: Bug Doesn't work as expected. label Feb 16, 2017
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Doesn't work as expected.
Development

Successfully merging this pull request may close these issues.

3 participants