Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make --example be the default #3856

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/command/add.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ For example:
);
argParser.addFlag(
'example',
defaultsTo: true,
help:
'Also update dependencies in `example/` after modifying pubspec.yaml in the root package (if it exists).',
hide: true,
Expand Down
1 change: 1 addition & 0 deletions lib/src/command/downgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class DowngradeCommand extends PubCommand {

argParser.addFlag(
'example',
defaultsTo: true,
help: 'Also run in `example/` (if it exists).',
hide: true,
);
Expand Down
1 change: 1 addition & 0 deletions lib/src/command/get.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class GetCommand extends PubCommand {

argParser.addFlag(
'example',
defaultsTo: true,
help: 'Also run in `example/` (if it exists).',
hide: true,
);
Expand Down
1 change: 1 addition & 0 deletions lib/src/command/remove.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ To remove a dependency override of a package prefix the package name with

argParser.addFlag(
'example',
defaultsTo: true,
help: 'Also update dependencies in `example/` (if it exists).',
hide: true,
);
Expand Down
1 change: 1 addition & 0 deletions lib/src/command/upgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class UpgradeCommand extends PubCommand {

argParser.addFlag(
'example',
defaultsTo: true,
help: 'Also run in `example/` (if it exists).',
hide: true,
);
Expand Down
2 changes: 1 addition & 1 deletion test/get/gets_in_example_folder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
])
]).create();

await pubCommand(command, args: []);
await pubCommand(command, args: ['--no-example']);
final lockFile = File(p.join(d.sandbox, appPath, 'pubspec.lock'));
final exampleLockFile = File(
p.join(d.sandbox, appPath, 'example', 'pubspec.lock'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $ pub add --directory=myapp foo
Resolving dependencies in myapp...
+ foo 1.0.0
Changed 1 dependency in myapp!
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

Expand All @@ -13,13 +15,17 @@ $ pub -C myapp add bar
Resolving dependencies in myapp...
+ bar 1.2.3
Changed 1 dependency in myapp!
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

## Section 2
$ pub -C 'myapp/example' get --directory=myapp bar
Resolving dependencies in myapp...
Got dependencies in myapp!
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

Expand All @@ -29,22 +35,24 @@ Resolving dependencies in myapp...
These packages are no longer being depended on:
- bar 1.2.3
Changed 1 dependency in myapp!
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

## Section 4
$ pub get bar -C myapp
Resolving dependencies in myapp...
Got dependencies in myapp!
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

## Section 5
$ pub get bar -C 'myapp/example'
Resolving dependencies in myapp/example...
+ foo 1.0.0
+ test_pkg 1.0.0 from path myapp
Changed 2 dependencies in myapp/example!
Got dependencies in myapp/example!

-------------------------------- END OF OUTPUT ---------------------------------

Expand Down Expand Up @@ -72,6 +80,8 @@ $ pub downgrade -C myapp
Resolving dependencies in myapp...
foo 1.0.0
No dependencies changed in myapp.
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

Expand All @@ -80,6 +90,8 @@ $ pub upgrade bar -C myapp
Resolving dependencies in myapp...
foo 1.0.0
No dependencies changed in myapp.
Resolving dependencies in myapp/example...
Got dependencies in myapp/example.

-------------------------------- END OF OUTPUT ---------------------------------

Expand Down