Skip to content

Commit b2247a7

Browse files
kevin-y-angclaude
andcommitted
[rush-lib] Add ensureFolderExists to plugin autoinstaller file writes
The read+write pattern introduced in PR microsoft#5678 replaced FileSystem.copyFile() which implicitly created destination folders. The writeFile() calls need ensureFolderExists: true to maintain the same behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 47be70b commit b2247a7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

libraries/rush-lib/src/pluginFramework/PluginLoader/AutoinstallerPluginLoader.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export class AutoinstallerPluginLoader extends PluginLoaderBase<IRushPluginConfi
7373
// Use read+write instead of copy to ensure line endings are normalized
7474
const manifestContent: string = FileSystem.readFile(manifestPath);
7575
FileSystem.writeFile(destinationManifestPath, manifestContent, {
76-
convertLineEndings: NewlineKind.Lf
76+
convertLineEndings: NewlineKind.Lf,
77+
ensureFolderExists: true
7778
});
7879
// Make permission consistent since it will be committed to Git
7980
FileSystem.changePosixModeBits(
@@ -105,7 +106,8 @@ export class AutoinstallerPluginLoader extends PluginLoaderBase<IRushPluginConfi
105106
// Use read+write instead of copy to ensure line endings are normalized
106107
const commandLineContent: string = FileSystem.readFile(commandLineJsonFullFilePath);
107108
FileSystem.writeFile(destinationCommandLineJsonFilePath, commandLineContent, {
108-
convertLineEndings: NewlineKind.Lf
109+
convertLineEndings: NewlineKind.Lf,
110+
ensureFolderExists: true
109111
});
110112
// Make permission consistent since it will be committed to Git
111113
FileSystem.changePosixModeBits(

0 commit comments

Comments
 (0)