Skip to content

Commit cc56972

Browse files
authored
Backwards compatibility for master/main (#243)
* Supports running on the `main` channel. * Pretends that the `master` channel is the main channel.
1 parent 50459a6 commit cc56972

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/snippets/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.3
2+
3+
* Backwards compatibility: Substitute in "main" when running on "master" channel.
4+
15
## 0.4.2
26

37
* Switch master channel to main.

packages/snippets/bin/snippets.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ String getChannelName({
5959
ProcessManager processManager = const LocalProcessManager(),
6060
}) {
6161
final String? envReleaseChannel = platform.environment['LUCI_BRANCH']?.trim();
62-
if (<String>['master', 'stable'].contains(envReleaseChannel)) {
62+
if (<String>['master', 'stable', 'main'].contains(envReleaseChannel)) {
63+
// Backward compatibility: Still support running on "master", but pretend it is "main".
64+
if (envReleaseChannel == 'master') {
65+
return 'main';
66+
}
6367
return envReleaseChannel!;
6468
}
6569

packages/snippets/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: snippets
22
description: A package for parsing and manipulating code samples in Flutter repo dartdoc comments.
33
repository: https://github.com/flutter/assets-for-api-docs/tree/main/packages/snippets
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+snippets%22
5-
version: 0.4.2
5+
version: 0.4.3
66

77
environment:
88
sdk: ">=3.0.0 <4.0.0"

0 commit comments

Comments
 (0)