Skip to content

Commit 435ea29

Browse files
committed
chore: update publish_flutter_quill.dart to update example/pubspec.lock
1 parent db54a85 commit 435ea29

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/publish_flutter_quill.dart

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const _targetPubspecYaml = './pubspec.yaml';
1616
// The flutter_quill CHANGELOG
1717
const _targetChangelog = './CHANGELOG.md';
1818

19+
const _exampleDirectory = './example';
20+
21+
const _targetExamplePubspecLock = '$_exampleDirectory/pubspec.lock';
22+
1923
const _confirmPublishOptionName = 'Y';
2024

2125
const _mainGitRemote = 'origin';
@@ -26,8 +30,8 @@ const _githubRepoActionsLink =
2630
const _changelogAndPubspecRestoreMessage =
2731
'ℹ️ Changes to CHANGELOG.md and pubspec.yaml have not been reverted.\n'
2832
'To revert them, run:\n'
29-
'git restore --staged $_targetChangelog $_targetPubspecYaml\n'
30-
'git restore $_targetChangelog $_targetPubspecYaml';
33+
'git restore --staged $_targetChangelog $_targetPubspecYaml $_targetExamplePubspecLock\n'
34+
'git restore $_targetChangelog $_targetPubspecYaml $_targetExamplePubspecLock';
3135

3236
void main(List<String> args) {
3337
print('➡️ Arguments provided: $args');
@@ -76,7 +80,16 @@ void main(List<String> args) {
7680
);
7781

7882
try {
79-
Process.runSync('git', ['add', _targetPubspecYaml, _targetChangelog]);
83+
// To update pubspec.lock of the example
84+
print(
85+
'ℹ️ Running `flutter pub get` in the example directory to update `pubspec.lock`...',
86+
);
87+
Process.runSync('flutter', ['pub', 'get', '-C', _exampleDirectory]);
88+
89+
Process.runSync(
90+
'git',
91+
['add', _targetPubspecYaml, _targetChangelog, _targetExamplePubspecLock],
92+
);
8093

8194
if (_isGitClean()) {
8295
print(

0 commit comments

Comments
 (0)