Skip to content

Commit

Permalink
Write an explicit line ending to the lockfile (#19519)
Browse files Browse the repository at this point in the history
Otherwise, we get the following change on Linux after generating the
lockfile on Windows.

```
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -4098,4 +4098,4 @@
       }
     }
   }
-}
+}
\ No newline at end of file
```

RELNOTES: None
PiperOrigin-RevId: 565042838
Change-Id: I5b93d155d7f1baf3a11b5d5aaf199e67b99af973
  • Loading branch information
meteorcloudy authored Sep 14, 2023
1 parent 2fe15f5 commit 7a86de3
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,12 @@ public static void updateLockfile(RootedPath lockfilePath, BazelLockFileValue up
lockfilePath.asPath(),
UTF_8,
GsonTypeAdapterUtil.createLockFileGson(
lockfilePath
.asPath()
.getParentDirectory()
.getRelative(LabelConstants.MODULE_DOT_BAZEL_FILE_NAME))
.toJson(updatedLockfile));
lockfilePath
.asPath()
.getParentDirectory()
.getRelative(LabelConstants.MODULE_DOT_BAZEL_FILE_NAME))
.toJson(updatedLockfile)
+ "\n");
} catch (IOException e) {
logger.atSevere().withCause(e).log(
"Error while updating MODULE.bazel.lock file: %s", e.getMessage());
Expand Down

0 comments on commit 7a86de3

Please sign in to comment.