From faf71b7931d2b27352bccd3c6be3cf872685f877 Mon Sep 17 00:00:00 2001 From: Nikola Buhinicek Date: Wed, 18 Sep 2019 13:16:08 +0200 Subject: [PATCH 1/2] Fixes #634 --- tasks/mina/install.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/mina/install.rb b/tasks/mina/install.rb index ac0cbbb6..6a18f50f 100644 --- a/tasks/mina/install.rb +++ b/tasks/mina/install.rb @@ -9,10 +9,17 @@ end outfile = './config/deploy.rb' + + if File.exists?(outfile) + print 'deploy.rb already exists, do you want to overwrite it? (y/n) ' + + exit(8) if $stdin.readline.chomp.downcase != 'y' + end + require 'fileutils' FileUtils.mkdir_p './config' FileUtils.cp Mina.root_path('data/deploy.rb'), outfile - puts "-----> Created #{outfile}" + puts "\n-----> Created #{outfile}" puts "Edit this file, then run `#{name} setup` after." end From 0ea9e68a56255e793aba24bb7ba8d4a6a40f2e23 Mon Sep 17 00:00:00 2001 From: Nikola Buhinicek Date: Wed, 18 Sep 2019 13:22:21 +0200 Subject: [PATCH 2/2] Remove unnecessary new line --- tasks/mina/install.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/mina/install.rb b/tasks/mina/install.rb index 6a18f50f..616af045 100644 --- a/tasks/mina/install.rb +++ b/tasks/mina/install.rb @@ -20,6 +20,6 @@ FileUtils.mkdir_p './config' FileUtils.cp Mina.root_path('data/deploy.rb'), outfile - puts "\n-----> Created #{outfile}" + puts "-----> Created #{outfile}" puts "Edit this file, then run `#{name} setup` after." end