Drop unnecessary directory list created during balena deploy & push

Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
This commit is contained in:
Thodoris Greasidis 2021-12-14 00:29:15 +02:00
parent 2b5c387313
commit f285880135

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);
}