mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-31 00:24:15 +00:00
Merge pull request #1009 from balena-io/ignored-balena-dir
Dont ignore balena metadata directories when balena pushing
This commit is contained in:
commit
0983bf02e2
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user