未验证 提交 229e4745 编写于 作者: A Alexander Aprelev 提交者: GitHub

Run frontend server from temp directory to force absolute URIs in Kernel file. (#4394)

* Run frontend server from temp directory to force absolute URIs in Kernel file.

* Create special directory to cwd into to avoid conflicts with app sources in temp folder

* Make variable final
上级 3f3d1749
...@@ -258,6 +258,13 @@ Future<int> starter(List<String> args, { ...@@ -258,6 +258,13 @@ Future<int> starter(List<String> args, {
compiler ??= new _FrontendCompiler(output, printerFactory: binaryPrinterFactory); compiler ??= new _FrontendCompiler(output, printerFactory: binaryPrinterFactory);
input ??= stdin; input ??= stdin;
// Has to be a directory, that won't have any of the compiled application
// sources, so that no relative paths could show up in the kernel file.
Directory.current = Directory.systemTemp;
final Directory workingDirectory = new Directory("flutter_frontend_server");
workingDirectory.createSync();
Directory.current = workingDirectory;
if (options.rest.isNotEmpty) { if (options.rest.isNotEmpty) {
await compiler.compile(options.rest[0], options, generator: generator); await compiler.compile(options.rest[0], options, generator: generator);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册