blob: 50c9120bb2f7adb57ff1d6af688c6ba7f4ef5094 [file] [log] [blame]
$ pub add --directory=myapp foo
Resolving dependencies...
+ foo 1.0.0
Changed 1 dependency in myapp!
$ pub -C myapp add bar
Resolving dependencies...
+ bar 1.2.3
Changed 1 dependency in myapp!
$ pub -C myapp/example get --directory=myapp bar
Resolving dependencies...
Got dependencies in myapp!
$ pub remove bar -C myapp
Resolving dependencies...
These packages are no longer being depended on:
- bar 1.2.3
Changed 1 dependency in myapp!
$ pub get bar -C myapp
Resolving dependencies...
Got dependencies in myapp!
$ pub get bar -C myapp/example
Resolving dependencies...
+ foo 1.0.0
+ test_pkg 1.0.0 from path myapp
Changed 2 dependencies in myapp/example!
$ pub get bar -C myapp/example2
Resolving dependencies...
[ERR] Error on line 1, column 9 of myapp/pubspec.yaml: "name" field doesn't match expected name "myapp".
[ERR] ╷
[ERR] 1 │ {"name":"test_pkg","version":"1.0.0","homepage":"http://pub.dartlang.org","description":"A package, I guess.","environment":{"sdk":">=1.8.0 <=2.0.0"}, dependencies: { foo: ^1.0.0}}
[ERR] │ ^^^^^^^^^^
[ERR] ╵
[Exit code] 65
$ pub get bar -C myapp/broken_dir
[ERR] Could not find a file named "pubspec.yaml" in "$SANDBOX/myapp/broken_dir".
[Exit code] 66
$ pub downgrade -C myapp
Resolving dependencies...
foo 1.0.0
No dependencies changed in myapp.
$ pub upgrade bar -C myapp
Resolving dependencies...
foo 1.0.0
No dependencies changed in myapp.
$ pub run -C myapp bin/app.dart
Hi
$ pub publish -C myapp --dry-run
Publishing test_pkg 1.0.0 to http://localhost:$PORT:
|-- CHANGELOG.md
|-- LICENSE
|-- README.md
|-- bin
| '-- app.dart
|-- example
| '-- pubspec.yaml
|-- example2
| '-- pubspec.yaml
|-- lib
| '-- test_pkg.dart
'-- pubspec.yaml
The server may enforce additional checks.
[ERR]
[ERR] Package has 0 warnings.
$ pub uploader -C myapp add sigurdm@google.com
Good job!
$ pub deps -C myapp
Dart SDK 1.12.0
test_pkg 1.0.0
'-- foo 1.0.0