Run frontend server from temp directory to force absolute URIs in Kernel file. (flutter/engine#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
This commit is contained in:
committed by
GitHub
parent
955b41aaba
commit
35acd03c15
@@ -258,6 +258,13 @@ Future<int> starter(List<String> args, {
|
||||
compiler ??= new _FrontendCompiler(output, printerFactory: binaryPrinterFactory);
|
||||
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) {
|
||||
await compiler.compile(options.rest[0], options, generator: generator);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user