Merge pull request #2409 from balena-io/drop-unused-dir-traversal-list

Drop unnecessary directory list created during balena deploy & push
This commit is contained in:
bulldozer-balena[bot] 2021-12-13 23:56:00 +00:00 committed by GitHub
commit 8abeb6aed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,9 +206,7 @@ export interface FileStats {
* @param projectDir Source directory (root of subtree to be listed)
*/
async function listFiles(projectDir: string): Promise<string[]> {
const dirs: string[] = [];
const files: string[] = [];
dirs.push(projectDir);
async function walk(currentDirs: string[]): Promise<string[]> {
if (!currentDirs.length) {
return files;
@ -229,7 +227,6 @@ async function listFiles(projectDir: string): Promise<string[]> {
const fpath = path.join(dir, entry.name);
if (entry.isDirectory()) {
foundDirs.push(fpath);
dirs.push(fpath);
} else {
files.push(fpath);
}