From 1e7a097c645d33f6f8b71cbe6d7d5eb4e201d1fa Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Thu, 1 Mar 2018 00:45:54 -0800 Subject: [PATCH] Symlink journal app if not a file --- scripts/Script.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Script.rb b/scripts/Script.rb index cbb7fb3..e9037b4 100644 --- a/scripts/Script.rb +++ b/scripts/Script.rb @@ -375,7 +375,8 @@ module Script def self.copy_journal Dir.mkdir(Oneshot::GAME_PATH) unless File.exists?(Oneshot::GAME_PATH) Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot") - begin #if File.exists?(Oneshot::JOURNAL) + begin + if File.file?(Oneshot::JOURNAL) File.open(Oneshot::JOURNAL, "rb") do |input| File.open(Oneshot::GAME_PATH + "/Oneshot/" + Oneshot::JOURNAL,"wb") do |output| while buff = input.read(4096) @@ -383,6 +384,9 @@ module Script end end end + else + File.symlink Dir.pwd + "/" + Oneshot::JOURNAL, Oneshot::GAME_PATH + "/Oneshot/" + Oneshot::JOURNAL + end rescue Errno::EACCES => e #this probably means the clover.exe already exists and is running, so no need to create it again end