Use FileSystem.pathSeparator instead of Platform.pathSeparator (#7417)
This commit is contained in:
@@ -10,7 +10,6 @@ import 'package:path/path.dart' as path;
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
import 'base/file_system.dart';
|
||||
import 'base/io.dart';
|
||||
import 'build_info.dart';
|
||||
import 'cache.dart';
|
||||
import 'dart/package_map.dart';
|
||||
@@ -378,7 +377,7 @@ Map<_Asset, List<_Asset>> _parseAssets(
|
||||
return result;
|
||||
|
||||
excludeDirs = excludeDirs.map(
|
||||
(String exclude) => path.absolute(exclude) + Platform.pathSeparator).toList();
|
||||
(String exclude) => path.absolute(exclude) + fs.pathSeparator).toList();
|
||||
|
||||
if (manifestDescriptor.containsKey('assets')) {
|
||||
for (String asset in manifestDescriptor['assets']) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'file_system.dart';
|
||||
import 'io.dart';
|
||||
import 'process_manager.dart';
|
||||
import '../globals.dart';
|
||||
@@ -202,7 +203,7 @@ void _traceCommand(List<String> args, { String workingDirectory }) {
|
||||
if (workingDirectory == null)
|
||||
printTrace(argsText);
|
||||
else
|
||||
printTrace("[$workingDirectory${Platform.pathSeparator}] $argsText");
|
||||
printTrace("[$workingDirectory${fs.pathSeparator}] $argsText");
|
||||
}
|
||||
|
||||
String _runWithLoggingSync(List<String> cmd, {
|
||||
|
||||
@@ -93,7 +93,7 @@ String getElapsedAsMilliseconds(Duration duration) {
|
||||
/// Return a relative path if [fullPath] is contained by the cwd, else return an
|
||||
/// absolute path.
|
||||
String getDisplayPath(String fullPath) {
|
||||
String cwd = fs.currentDirectory.path + Platform.pathSeparator;
|
||||
String cwd = fs.currentDirectory.path + fs.pathSeparator;
|
||||
return fullPath.startsWith(cwd) ? fullPath.substring(cwd.length) : fullPath;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:args/args.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import '../base/file_system.dart';
|
||||
import '../base/io.dart';
|
||||
import '../base/utils.dart';
|
||||
import '../cache.dart';
|
||||
import '../globals.dart';
|
||||
@@ -59,7 +58,7 @@ bool inRepo(List<String> fileList) {
|
||||
if (fileList == null || fileList.isEmpty)
|
||||
fileList = <String>[path.current];
|
||||
String root = path.normalize(path.absolute(Cache.flutterRoot));
|
||||
String prefix = root + Platform.pathSeparator;
|
||||
String prefix = root + fs.pathSeparator;
|
||||
for (String file in fileList) {
|
||||
file = path.normalize(path.absolute(file));
|
||||
if (file == root || file.startsWith(prefix))
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:meta/meta.dart';
|
||||
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/io.dart';
|
||||
import '../base/utils.dart';
|
||||
import '../build_info.dart';
|
||||
import '../globals.dart';
|
||||
@@ -88,7 +87,7 @@ class BuildCleanCommand extends FlutterCommand {
|
||||
@override
|
||||
Future<Null> runCommand() async {
|
||||
Directory buildDir = fs.directory(getBuildDirectory());
|
||||
printStatus("Deleting '${buildDir.path}${Platform.pathSeparator}'.");
|
||||
printStatus("Deleting '${buildDir.path}${fs.pathSeparator}'.");
|
||||
|
||||
if (!buildDir.existsSync())
|
||||
return;
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
import '../base/common.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/io.dart';
|
||||
import '../base/logger.dart';
|
||||
import '../base/process.dart';
|
||||
import '../base/utils.dart';
|
||||
@@ -65,7 +64,7 @@ class BuildAotCommand extends BuildSubCommand {
|
||||
if (outputPath == null)
|
||||
throwToolExit(null);
|
||||
|
||||
printStatus('Built to $outputPath${Platform.pathSeparator}.');
|
||||
printStatus('Built to $outputPath${fs.pathSeparator}.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user