mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 02:01:35 +00:00
Clear changed files after successful livepush invocation
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
67c3055fd4
commit
4f2a534075
@ -40,16 +40,18 @@ export async function startLivepush(opts: {
|
||||
ignored: /((^|[\/\\])\..|(node_modules|sync|test)\/.*)/,
|
||||
ignoreInitial: opts.noinit,
|
||||
})
|
||||
.on('add', path => livepushExecutor(path))
|
||||
.on('change', path => livepushExecutor(path))
|
||||
.on('unlink', path => livepushExecutor(undefined, path));
|
||||
.on('add', (path) => livepushExecutor(path))
|
||||
.on('change', (path) => livepushExecutor(path))
|
||||
.on('unlink', (path) => livepushExecutor(undefined, path));
|
||||
}
|
||||
|
||||
const getExecutor = (livepush: Livepush) => {
|
||||
const changedFiles: string[] = [];
|
||||
const deletedFiles: string[] = [];
|
||||
let changedFiles: string[] = [];
|
||||
let deletedFiles: string[] = [];
|
||||
const actualExecutor = _.debounce(async () => {
|
||||
await livepush.performLivepush(changedFiles, deletedFiles);
|
||||
changedFiles = [];
|
||||
deletedFiles = [];
|
||||
});
|
||||
return (changed?: string, deleted?: string) => {
|
||||
if (changed) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user