Skip to content

Commit f77ef92

Browse files
committed
Only delete known_hosts if .keep_known_hosts does not exist
1 parent 6d22e6e commit f77ef92

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.keep_known_hosts
12
packer_cache/
23
output-*
34
*.box

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -709,17 +709,17 @@ clean-packer-cache:
709709
rm -rf packer_cache
710710

711711
test-$(VMWARE_BOX_DIR)/%$(BOX_SUFFIX): $(VMWARE_BOX_DIR)/%$(BOX_SUFFIX)
712-
rm -f ~/.ssh/known_hosts
712+
-test -f .keep_known_hosts || rm -f ~/.ssh/known_hosts
713713
bin/test-box.sh $< vmware_desktop $(VAGRANT_PROVIDER) $(CURRENT_DIR)/test/*_spec.rb
714714

715715
test-$(VIRTUALBOX_BOX_DIR)/%$(BOX_SUFFIX): $(VIRTUALBOX_BOX_DIR)/%$(BOX_SUFFIX)
716-
rm -f ~/.ssh/known_hosts
716+
-test -f .keep_known_hosts || rm -f ~/.ssh/known_hosts
717717
bin/test-box.sh $< virtualbox virtualbox $(CURRENT_DIR)/test/*_spec.rb
718718

719719
ssh-$(VMWARE_BOX_DIR)/%$(BOX_SUFFIX): $(VMWARE_BOX_DIR)/%$(BOX_SUFFIX)
720-
rm -f ~/.ssh/known_hosts
720+
-test -f .keep_known_hosts || rm -f ~/.ssh/known_hosts
721721
bin/ssh-box.sh $< vmware_desktop $(VAGRANT_PROVIDER) $(CURRENT_DIR)/test/*_spec.rb
722722

723723
ssh-$(VIRTUALBOX_BOX_DIR)/%$(BOX_SUFFIX): $(VIRTUALBOX_BOX_DIR)/%$(BOX_SUFFIX)
724-
rm -f ~/.ssh/known_hosts
724+
-test -f .keep_known_hosts || rm -f ~/.ssh/known_hosts
725725
bin/ssh-box.sh $< virtualbox virtualbox $(CURRENT_DIR)/test/*_spec.rb

0 commit comments

Comments
 (0)