Ensure that taze doesn't modify BUILDs with no TypeScript.
PiperOrigin-RevId: 223402465
diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go
index 3a41b10..83d1ddb 100644
--- a/ts_auto_deps/updater/updater.go
+++ b/ts_auto_deps/updater/updater.go
@@ -517,6 +517,10 @@
}
platform.Infof("Updating sources")
+ if len(srcs) == 0 && len(allTSRules(bld)) == 0 {
+ // No TypeScript rules/sources, no need to update anything
+ return false, nil
+ }
updateSources(bld, srcs)
return upd.maybeWriteBUILD(ctx, buildFilePath, bld)