mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-21 14:29:55 +00:00
Symlink journal app if not a file
This commit is contained in:
parent
357ecc520b
commit
1e7a097c64
1 changed files with 5 additions and 1 deletions
|
|
@ -375,13 +375,17 @@ module Script
|
||||||
def self.copy_journal
|
def self.copy_journal
|
||||||
Dir.mkdir(Oneshot::GAME_PATH) unless File.exists?(Oneshot::GAME_PATH)
|
Dir.mkdir(Oneshot::GAME_PATH) unless File.exists?(Oneshot::GAME_PATH)
|
||||||
Dir.mkdir(Oneshot::GAME_PATH + "/Oneshot") unless File.exists?(Oneshot::GAME_PATH + "/Oneshot")
|
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::JOURNAL, "rb") do |input|
|
||||||
File.open(Oneshot::GAME_PATH + "/Oneshot/" + Oneshot::JOURNAL,"wb") do |output|
|
File.open(Oneshot::GAME_PATH + "/Oneshot/" + Oneshot::JOURNAL,"wb") do |output|
|
||||||
while buff = input.read(4096)
|
while buff = input.read(4096)
|
||||||
output.write(buff)
|
output.write(buff)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
File.symlink Dir.pwd + "/" + Oneshot::JOURNAL, Oneshot::GAME_PATH + "/Oneshot/" + Oneshot::JOURNAL
|
||||||
end
|
end
|
||||||
rescue Errno::EACCES => e
|
rescue Errno::EACCES => e
|
||||||
#this probably means the clover.exe already exists and is running, so no need to create it again
|
#this probably means the clover.exe already exists and is running, so no need to create it again
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue