Dont ignore balena metadata directories when balena pushing

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2018-11-01 12:21:56 +00:00
parent fdc9fd67d8
commit 0deb59b6e2
No known key found for this signature in database
GPG Key ID: 69264F9C923F55C1

View File

@ -77,6 +77,7 @@ export class FileIgnorer {
if (/\s*#/.test(line) || _.isEmpty(line)) {
return;
}
this.addEntry(line, fullPath, type);
});
@ -86,6 +87,14 @@ export class FileIgnorer {
// Pass this function as a predicate to a filter function, and it will filter
// any ignored files
public filter = (filename: string): boolean => {
const relFile = path.relative(this.basePath, filename);
// Don't ignore any metadata files
const baseDir = path.dirname(relFile).split(path.sep)[0];
if (baseDir === '.balena' || baseDir === '.resin') {
return true;
}
const dockerIgnoreHandle = dockerIgnore();
const gitIgnoreHandle = ignore();
@ -102,8 +111,6 @@ export class FileIgnorer {
{ handle: gitIgnoreHandle, entries: this.gitIgnoreEntries },
];
const relFile = path.relative(this.basePath, filename);
_.each(ignoreTypes, ({ handle, entries }) => {
_.each(entries, ({ pattern, filePath }) => {
if (FileIgnorer.contains(path.posix.dirname(filePath), filename)) {