Skip to content

Commit

Permalink
Manually resolve symlinks before deploying sub-packages (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Aug 3, 2021
1 parent 667e9f4 commit 1157d3c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.37.4

* No user-visible changes.

## 1.37.3

* No user-visible changes.
Expand Down
20 changes: 0 additions & 20 deletions pkg/sass_api/LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions pkg/sass_api/LICENSE
2 changes: 1 addition & 1 deletion pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
sdk: '>=2.12.0 <3.0.0'

dependencies:
sass: 1.37.3
sass: 1.37.4

dependency_overrides:
sass: {path: ../..}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.37.3
version: 1.37.4
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down
11 changes: 11 additions & 0 deletions tool/grind/subpackages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ Future<void> deploySubPackages() async {
pubspecYaml.remove("dependency_overrides");
File(pubspecPath).writeAsStringSync(json.encode(pubspecYaml));

// We use symlinks to avoid duplicating files between the main repo and
// child repos, but `pub lish` doesn't resolve these before publishing so we
// have to do so manually.
for (var entry
in Directory(package).listSync(recursive: true, followLinks: false)) {
if (entry is! Link) continue;
var target = p.join(p.dirname(entry.path), entry.targetSync());
entry.deleteSync();
File(entry.path).writeAsStringSync(File(target).readAsStringSync());
}

log("pub publish ${pubspec.name}");
var process = await Process.start(
p.join(sdkDir.path, "bin/pub"), ["publish", "--force"],
Expand Down

0 comments on commit 1157d3c

Please sign in to comment.