lib/prlbackup.rb in prlbackup-1.1.1 vs lib/prlbackup.rb in prlbackup-1.1.2

- old
+ new

@@ -11,13 +11,13 @@ attr_accessor :config end # Run the command and log the last line from stdout unless --dry-run. # @return [String] stdout of the comand. - def command!(*args) + def conditionally_run(*args) unless PrlBackup.config[:dry_run] - output = command(*args) + output = run(*args) logger.info(output.split("\n").last) else output = '' logger.info("Dry-running `#{args.shelljoin}`...") end @@ -25,10 +25,10 @@ end # Run the command until it is finished. # @Note This will even run when option --dry-run is selected! # @return [String] stdout of the comand. - def command(*args) + def run(*args) logger.info("Running `#{args.shelljoin}`...") if PrlBackup.config[:verbose] output = `#{args.shelljoin} 2>&1` status = $? unless status.success? logger.error("Command `#{args.shelljoin}` failed with exit status #{status.exitstatus}:\n#{output}")