Skip to content

Commit 915d590

Browse files
committed
feat(update): log updates after they are applied
Prevents updates that have no effect from being logged
1 parent 55e25d8 commit 915d590

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

project/update.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function step(project: Project, git: SimpleGit): (update: Update) => Promise<Upd
6868
git
6969
.status()
7070
.then(status => (status.isClean() ? success() : failure([gitNotClean(project.path)])))
71-
.then(mapResultFn(() => console.log(`Applying update: ${update.log}`)))
7271
.then(
7372
bindAsyncResultFn<GitNotClean, UpdateFailureReason>(async () =>
7473
update.type === "fs-stage-update"
@@ -88,5 +87,11 @@ function step(project: Project, git: SimpleGit): (update: Update) => Promise<Upd
8887
: git.add(files).then(async () => git.commit(update.log))
8988
)
9089
)
91-
.then(mapResultFn(() => undefined));
90+
.then(
91+
mapResultFn(commitResult => {
92+
if (commitResult != null) {
93+
console.log(`Applied update: ${update.log}`);
94+
}
95+
})
96+
);
9297
}

0 commit comments

Comments
 (0)