Merge pull request #2410 from balena-io/fix-symlink-push-deploy

Fix symbolic link regression in push & deploy
This commit is contained in:
bulldozer-balena[bot] 2021-12-14 01:56:06 +00:00 committed by GitHub
commit 40e0b2dbed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,11 @@ async function listFiles(projectDir: string): Promise<string[]> {
const _files = await fs.readdir(dir, { withFileTypes: true });
for (const entry of _files) {
const fpath = path.join(dir, entry.name);
if (entry.isDirectory()) {
const isDirectory =
entry.isDirectory() ||
(entry.isSymbolicLink() && (await fs.stat(fpath)).isDirectory());
if (isDirectory) {
foundDirs.push(fpath);
} else {
files.push(fpath);