Commit 8b49ee0

mo khan <mo@mokhan.ca>
2021-02-06 18:57:30
feat: add setup command for instructions on how to integrate into shell
1 parent b12aa84
lib/jive/cli.rb
@@ -24,6 +24,15 @@ module Jive
         ])
       end
 
+      desc "setup", "provide instructions to integrate into shell"
+      def setup
+        say <<~MESSAGE
+          Include the following in your ~/.bash_profile
+
+            source #{::Jive.root.join("jive.sh")}
+        MESSAGE
+      end
+
       private
 
       COMMAND_MAP = {
lib/jive/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module Jive
-  VERSION = "0.2.0"
+  VERSION = "0.2.1"
 end
lib/jive.rb
@@ -11,6 +11,10 @@ require "jive/version"
 module Jive
   class Error < StandardError; end
 
+  def self.root
+    @root ||= Pathname.new(__FILE__).parent.parent
+  end
+
   def self.run(tasks)
     Jive::BatchRunner.new.run(tasks)
   end
jive.gemspec
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
   spec.executables   = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
   spec.require_paths = ["lib"]
   spec.post_install_message = <<~MESSAGE
-    Include the following in your ~/.bash_profile
+    Run the following command for setup instructions:
 
-      source #{__dir__}/jive.sh
+      $ jive setup
   MESSAGE
 
   spec.add_dependency "thor", "~> 1.1"