Skip to content

Commit

Permalink
fix(bricks): windows prod build use copyPath (felangel#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed May 26, 2022
1 parent 294196e commit cc74997
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
19 changes: 8 additions & 11 deletions bricks/dart_frog_prod_server/hooks/pre_gen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:dart_frog_gen/dart_frog_gen.dart';
import 'package:io/io.dart';
import 'package:mason/mason.dart';
import 'package:path/path.dart' as path;
import 'package:pubspec_parse/pubspec_parse.dart';
Expand Down Expand Up @@ -36,17 +37,13 @@ Future<void> run(HookContext context) async {
}

final tempDirectory = await Directory.systemTemp.createTemp();
final result = await Process.run(
'cp',
['-rf', '.', '${tempDirectory.path}${path.separator}'],
workingDirectory: projectDirectory.path,
runInShell: true,
);
bundlingDone();

if (result.exitCode != 0) {
context.logger.err('${result.stderr}');
exit(result.exitCode);
try {
await copyPath('.', '${tempDirectory.path}${path.separator}');
bundlingDone();
} catch (error) {
bundlingDone();
context.logger.err('$error');
exit(1);
}

await tempDirectory.rename(buildDirectoryPath);
Expand Down
7 changes: 7 additions & 0 deletions bricks/dart_frog_prod_server/hooks/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
io:
dependency: "direct main"
description:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
json_annotation:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions bricks/dart_frog_prod_server/hooks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ environment:

dependencies:
dart_frog_gen: ^0.0.2-dev.1
io: ^1.0.3
mason: ">=0.1.0-dev <0.1.0"
path: ^1.8.1
pubspec_parse: ^1.2.0

0 comments on commit cc74997

Please sign in to comment.