diff --git a/lib/kamal/cli/main.rb b/lib/kamal/cli/main.rb index 2cb925065..34130a495 100644 --- a/lib/kamal/cli/main.rb +++ b/lib/kamal/cli/main.rb @@ -152,13 +152,13 @@ def init puts "Created .env file" end - unless (hooks_dir = Pathname.new(File.expand_path(".kamal/hooks"))).exist? - hooks_dir.mkpath - Pathname.new(File.expand_path("templates/sample_hooks", __dir__)).each_child do |sample_hook| - FileUtils.cp sample_hook, hooks_dir, preserve: true - end - puts "Created sample hooks in .kamal/hooks" + hooks_dir = Pathname.new(File.expand_path(".kamal/hooks")) + puts "Hooks directory already exists in .kamal/hooks" if hooks_dir.exist? + hooks_dir.mkpath + Pathname.new(File.expand_path("templates/sample_hooks", __dir__)).each_child do |sample_hook| + FileUtils.cp sample_hook, hooks_dir, preserve: true end + puts "Created sample hooks in .kamal/hooks" if options[:bundle] if (binstub = Pathname.new(File.expand_path("bin/kamal"))).exist?