Skip to content

Commit 56b8c09

Browse files
committed
recursiveReaddir
1 parent 952c36c commit 56b8c09

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
"dependencies": {
99
"@actions/cache": "^1.0.2",
1010
"@actions/core": "^1.2.4",
11+
"@types/recursive-readdir": "^2.2.0",
1112
"actions-exec-listener": "^0.0.2",
1213
"crypto": "^1.0.1",
1314
"native-promise-pool": "^3.13.0",
15+
"recursive-readdir": "^2.2.2",
1416
"string-format": "^2.0.0",
1517
"typescript-is": "^0.16.3"
1618
},

src/LayerCache.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import * as core from '@actions/core'
55
import * as cache from '@actions/cache'
66
import { ExecOptions } from '@actions/exec/lib/interfaces'
77
import { promises as fs } from 'fs'
8-
import { assertManifests, Manifest, Manifests, loadManifests, loadRawManifests } from './Tar'
8+
import recursiveReaddir from 'recursive-readdir'
9+
import { Manifest, loadManifests, loadRawManifests } from './Tar'
910
import format from 'string-format'
1011
import PromisePool from 'native-promise-pool'
1112

@@ -92,7 +93,7 @@ class LayerCache {
9293
}
9394

9495
private async moveLayerTarsInDir(fromDir: string, toDir: string) {
95-
const layerTars = (await fs.readdir(fromDir)).filter(path => path.endsWith(`/layer.tar`))
96+
const layerTars = (await recursiveReaddir(fromDir)).filter(path => path.endsWith(`/layer.tar`))
9697

9798
const moveLayer = async (layer: string) => {
9899
const from = path.resolve(`${fromDir}/${layer}`)

yarn.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@
186186
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.27.tgz#a151873af5a5e851b51b3b065c9e63390a9e0eb1"
187187
integrity sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==
188188

189+
"@types/recursive-readdir@^2.2.0":
190+
version "2.2.0"
191+
resolved "https://registry.yarnpkg.com/@types/recursive-readdir/-/recursive-readdir-2.2.0.tgz#b39cd5474fd58ea727fe434d5c68b7a20ba9121c"
192+
integrity sha512-HGk753KRu2N4mWduovY4BLjYq4jTOL29gV2OfGdGxHcPSWGFkC5RRIdk+VTs5XmYd7MVAD+JwKrcb5+5Y7FOCg==
193+
dependencies:
194+
"@types/node" "*"
195+
189196
"@types/string-format@^2.0.0":
190197
version "2.0.0"
191198
resolved "https://registry.yarnpkg.com/@types/string-format/-/string-format-2.0.0.tgz#c1588f507be7b8ef5eb5074a41e48e4538f3f6d5"
@@ -322,7 +329,7 @@ mime-types@^2.1.12:
322329
dependencies:
323330
mime-db "1.44.0"
324331

325-
minimatch@^3.0.4:
332+
minimatch@3.0.4, minimatch@^3.0.4:
326333
version "3.0.4"
327334
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
328335
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
@@ -364,6 +371,13 @@ punycode@^2.1.1:
364371
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
365372
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
366373

374+
recursive-readdir@^2.2.2:
375+
version "2.2.2"
376+
resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f"
377+
integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==
378+
dependencies:
379+
minimatch "3.0.4"
380+
367381
reflect-metadata@>=0.1.12:
368382
version "0.1.13"
369383
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08"

0 commit comments

Comments
 (0)