lib/coderunner/interactive_methods.rb in coderunner-0.16.2 vs lib/coderunner/interactive_methods.rb in coderunner-0.16.3
- old
+ new
@@ -16,14 +16,15 @@
end
def setup_interactive
@runner = CodeRunner.fetch_runner(CodeRunner::DEFAULT_COMMAND_OPTIONS.dup) unless CodeRunner::DEFAULT_COMMAND_OPTIONS[:q]
@r = @runner
if @r
- if FileTest.exist?(@r.root_folder + '/.code-runner-irb-save-history')
+ histfile = @r.root_folder + '/.code-runner-irb-save-history'
+ if FileTest.exist?(histfile)
if @r.is_in_repo?
repo = Repository.open_in_subfolder(@r.root_folder)
- repo.add(@r.root_folder + '/.code-runner-irb-save-history')
- repo.autocommit("--Updated save history in #{repo.relative_path(@r.root_folder)}")
+ repo.add(histfile)
+ repo.autocommit("Updated save history in #{repo.relative_path(@r.root_folder)}") if repo.modified? histfile
end
end
end
end