Skip to content

Commit

Permalink
Released 5.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutton committed Oct 25, 2023
1 parent 07c6451 commit b386611
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 104 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 5.1.0
- moved to pubspec_manager

# 5.0.2
- upgrade dependency versions

Expand Down
21 changes: 8 additions & 13 deletions bin/dswitch_install.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:dswitch/src/constants.dart';
import 'package:dswitch/src/exceptions/exit.dart';
import 'package:dswitch/src/settings.dart';
import 'package:path/path.dart';
import 'package:pubspec2/pubspec2.dart' as ps;
import 'package:pubspec_manager/pubspec_manager.dart';

void main(List<String> args) {
final argParser = ArgParser()
Expand Down Expand Up @@ -141,22 +141,17 @@ void runStage1() {
/// so the copied pubspec.yaml will still function.
void hackPubspecForDev(String pathToDSwitch, String compileDir) {
final pathToPubspec = truepath(compileDir, 'pubspec.yaml');
final pubspec = PubSpec.fromFile(pathToPubspec);
final pubspec = PubSpec.loadFromPath(pathToPubspec);

if (pubspec.dependencyOverrides.containsKey('dcli')) {
if (pubspec.dependencyOverrides.exists('dcli')) {
final overrides = pubspec.dependencyOverrides;

final dcli = overrides['dcli'];
if (dcli!.reference is ps.PathReference) {
var pathRef = dcli.reference as ps.PathReference;
pathRef = ps.PathReference(truepath(pathToDSwitch, pathRef.path));
final dcliDependenchy = overrides['dcli']! as PathDependency;

final replacement = <String, Dependency>{}..addAll(overrides);
replacement['dcli'] = Dependency('dcli', pathRef);
pubspec
..dependencyOverrides = replacement
..save(pathToPubspec);
}
final absolutePathToDCli = truepath(pathToDSwitch, dcliDependenchy.path);
(overrides['dcli']! as PathDependency).path = absolutePathToDCli;

pubspec.saveTo(pathToPubspec);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/version/version.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/// GENERATED BY pub_release do not modify.
/// dswitch version
String packageVersion = '5.0.2';
String packageVersion = '5.1.0';
Loading

0 comments on commit b386611

Please sign in to comment.