images folder might not exist
This commit is contained in:
@@ -688,17 +688,18 @@ open IO.FS System FilePath in
|
|||||||
/-- Copies the folder `images/` to `.lake/gamedata/images/` -/
|
/-- Copies the folder `images/` to `.lake/gamedata/images/` -/
|
||||||
def copyImages : IO Unit := do
|
def copyImages : IO Unit := do
|
||||||
let target : FilePath := ".lake" / "gamedata"
|
let target : FilePath := ".lake" / "gamedata"
|
||||||
for file in ← walkDir "images" do
|
if ← FilePath.pathExists "images" then
|
||||||
let outFile := target.join file
|
for file in ← walkDir "images" do
|
||||||
-- create the directories
|
let outFile := target.join file
|
||||||
if ← file.isDir then
|
-- create the directories
|
||||||
createDirAll outFile
|
if ← file.isDir then
|
||||||
else
|
createDirAll outFile
|
||||||
if let some parent := outFile.parent then
|
else
|
||||||
createDirAll parent
|
if let some parent := outFile.parent then
|
||||||
-- copy file
|
createDirAll parent
|
||||||
let content ← readBinFile file
|
-- copy file
|
||||||
writeBinFile outFile content
|
let content ← readBinFile file
|
||||||
|
writeBinFile outFile content
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user