From c44e2245873604ae3e7105daf38ece8d17b157c3 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 14 Jan 2023 11:44:16 +0100 Subject: [PATCH] Add option to skip binstubs for older apps --- lib/mrsk/cli/main.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/mrsk/cli/main.rb b/lib/mrsk/cli/main.rb index 607c5fca..4a04ed6e 100644 --- a/lib/mrsk/cli/main.rb +++ b/lib/mrsk/cli/main.rb @@ -42,6 +42,7 @@ class Mrsk::Cli::Main < Mrsk::Cli::Base end desc "install", "Create config stub in config/deploy.yml and binstub in bin/mrsk" + option :skip_binstub, type: :boolean, default: false, desc: "Skip adding MRSK to the Gemfile and creating bin/mrsk binstub" def install require "fileutils" @@ -52,11 +53,14 @@ class Mrsk::Cli::Main < Mrsk::Cli::Base puts "Created configuration file in config/deploy.yml" end - if (binstub = Pathname.new(File.expand_path("bin/mrsk"))).exist? - puts "Binstub already exists in bin/mrsk (remove first to create a new one)" - else - `bundle binstubs mrsk` - puts "Created binstub file in bin/mrsk" + unless options[:skip_binstub] + if (binstub = Pathname.new(File.expand_path("bin/mrsk"))).exist? + puts "Binstub already exists in bin/mrsk (remove first to create a new one)" + else + `bundle add mrsk` + `bundle binstubs mrsk` + puts "Created binstub file in bin/mrsk" + end end end