Skip to content

Commit

Permalink
Assets are listed from relative asset dir
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Sep 22, 2023
1 parent e40e801 commit 80fd6bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ final case class IndigoAssets(
def listAssetFiles(baseDirectory: os.Path): List[os.RelPath] =
filesToCopy(baseDirectory)
.filterNot(os.isDir)
.map(_.relativeTo(baseDirectory))
.map(_.relativeTo(baseDirectory / gameAssetsDirectory / os.RelPath.up))
def listAssetFiles: List[os.RelPath] =
listAssetFiles(os.pwd)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ class AcceptanceTests extends munit.FunSuite {
assert(clue(expected).forall(clue(actual).contains))
}

test("List all asset files as relative paths - sub dir") {
val actual: List[os.RelPath] =
indigoAssets
.withAssetDirectory(sourceDir / "mixed")
.listAssetFiles

val expected: List[os.RelPath] =
List(
os.RelPath.rel / "mixed" / "ignored-file.txt",
os.RelPath.rel / "mixed" / "also-taken.txt",
os.RelPath.rel / "mixed" / "taken.txt"
)

assertEquals(actual.length, expected.length)
assert(clue(expected).forall(clue(actual).contains))
}

test("Copy assets and assert expected output files") {
val baseDirectory = os.pwd

Expand Down

0 comments on commit 80fd6bb

Please sign in to comment.