Commit 9b63ec6

mo khan <mo@mokhan.ca>
2021-02-07 00:01:38
style: fix linter errors
1 parent e22bdfb
Changed files (1)
lib
lib/jive/cli.rb
@@ -30,17 +30,14 @@ module Jive
       desc "exec <command>", "run command from jive.yml"
       def exec(command)
         path = Pathname.pwd.join("jive.yml")
-        if path.exist?
-          runner.run_safely do
-            runner.execute(
-              YAML
-              .safe_load(path.read)
-              .dig("commands", command)
-            )
-          end
-        else
-          say "Error: jive.yml not found"
-          exit 2
+        return shell.error("Error: jive.yml not found") unless path.exist?
+
+        runner.run_safely do
+          runner.execute(
+            YAML
+            .safe_load(path.read)
+            .dig("commands", command)
+          )
         end
       end