Skip to content

Commit fa113b0

Browse files
committed
Fix #13 linux issue where directory needs to be written first
1 parent 817940f commit fa113b0

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

Automatic Snapshot.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ function RecordingContext:_promote_v2_to_v3()
115115
end
116116

117117
function RecordingContext:get_recording_image_path(index)
118+
if not app.fs.isDirectory(self.record_directory_path) then
119+
app.fs.makeDirectory(self.record_directory_path)
120+
end
121+
118122
return app.fs.joinPath(self.record_directory_path, self.sprite_file_name .. "_" .. index .. ".png")
119123
end
120124

@@ -210,6 +214,7 @@ function Snapshot:save()
210214
local image = self:_get_current_image()
211215
local index = self.context:get_recording_index()
212216
local path = self:get_recording_image_path(index)
217+
213218
image:saveAs{
214219
filename = path,
215220
palette = self.sprite.palettes[1]

Command Palette.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ function RecordingContext:_promote_v2_to_v3()
113113
end
114114

115115
function RecordingContext:get_recording_image_path(index)
116+
if not app.fs.isDirectory(self.record_directory_path) then
117+
app.fs.makeDirectory(self.record_directory_path)
118+
end
119+
116120
return app.fs.joinPath(self.record_directory_path, self.sprite_file_name .. "_" .. index .. ".png")
117121
end
118122

Open Time Lapse.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ function RecordingContext:_promote_v2_to_v3()
113113
end
114114

115115
function RecordingContext:get_recording_image_path(index)
116+
if not app.fs.isDirectory(self.record_directory_path) then
117+
app.fs.makeDirectory(self.record_directory_path)
118+
end
119+
116120
return app.fs.joinPath(self.record_directory_path, self.sprite_file_name .. "_" .. index .. ".png")
117121
end
118122

Take Snapshot.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ function RecordingContext:_promote_v2_to_v3()
113113
end
114114

115115
function RecordingContext:get_recording_image_path(index)
116+
if not app.fs.isDirectory(self.record_directory_path) then
117+
app.fs.makeDirectory(self.record_directory_path)
118+
end
119+
116120
return app.fs.joinPath(self.record_directory_path, self.sprite_file_name .. "_" .. index .. ".png")
117121
end
118122

0 commit comments

Comments
 (0)