Skip to content

Commit 632092d

Browse files
committed
Boot - clear logs, don’t nuke them
* Windows doesn’t let you nuke the log dir due to permissions * Instead clear the existing files * This makes tailing files work across app runs again, yey! :-)
1 parent a0c8bc1 commit 632092d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/server/bin/clear-logs.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818

1919
include SonicPi::Util
2020

21-
FileUtils.rm_rf log_path if File.exists? log_path
21+
# Clear out all logs (don't remove the files, just empty them)
22+
Dir["#{log_path}/*"].each do |p|
23+
File.open(p, 'w') {|file| file.truncate(0) }
24+
end

0 commit comments

Comments
 (0)