transferPackageConfig static method
Future
transferPackageConfig({
- required String fromPackage,
- required String toPackage,
- required StdoutSession stdoutSession,
- ({String newPackageName, String oldPackageName})? packageNameReplacementInfo,
Implementation
static Future transferPackageConfig({
required String fromPackage,
required String toPackage,
required StdoutSession stdoutSession,
({
String oldPackageName,
String newPackageName
})? packageNameReplacementInfo,
}) async {
final fromPackageConfigPath = getPackageConfigPathForPackage(fromPackage,
stdoutSession: stdoutSession, doCheckWorkspace: true);
final toPackageConfigPath = getPackageConfigPathForPackage(toPackage,
stdoutSession: stdoutSession, doCheckWorkspace: true);
Directory(path.dirname(toPackageConfigPath)).createSync(recursive: true);
File(toPackageConfigPath)
.writeAsStringSync(File(fromPackageConfigPath).readAsStringSync());
await _adaptPackageConfigToAbsolutePaths(
targetPackageConfigPath: toPackageConfigPath,
sourcePackageConfigPath: fromPackageConfigPath,
packageNameReplacementInfo: packageNameReplacementInfo,
);
}