Commit 9b63ec6
Changed files (1)
lib
jive
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