Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
Workaround FileUtils.ln_s(src, dest, force: true) not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Andrews committed Mar 25, 2015
1 parent ba91156 commit fc3b1b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/masamune/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def logger
@log_file_name = filesystem.get_path(:log_dir, log_file_template)
log_file = File.open(@log_file_name, 'a')
log_file.sync = true
FileUtils.ln_s(log_file, filesystem.path(:log_dir, 'latest'), force: true)

latest = filesystem.path(:log_dir, 'latest')
FileUtils.rm(latest) if File.exists?(latest)
FileUtils.ln_s(log_file, latest)
configuration.debug ? Masamune::MultiIO.new($stderr, log_file) : log_file
else
configuration.debug ? $stderr : nil
Expand Down

0 comments on commit fc3b1b7

Please sign in to comment.