Skip to content

Commit 8d4a245

Browse files
author
Nick Pape
committed
More PR Feedback
1 parent ef8e1ce commit 8d4a245

File tree

19 files changed

+45
-38
lines changed

19 files changed

+45
-38
lines changed

apps/api-documenter/src/markdown/MarkdownDocumenter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,6 @@ export class MarkdownDocumenter {
619619

620620
private _deleteOldOutputFiles(): void {
621621
console.log('Deleting old output from ' + this._outputFolder);
622-
FileSystem.emptyFolder(this._outputFolder);
622+
FileSystem.ensureEmptyFolder(this._outputFolder);
623623
}
624624
}

apps/api-documenter/src/yaml/YamlDocumenter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ export class YamlDocumenter {
420420

421421
FileSystem.writeFile(filePath, stringified, {
422422
convertLineEndings: NewlineKind.CrLf,
423-
ensureFolder: true
423+
ensureFolderExists: true
424424
});
425425

426426
if (schema) {
@@ -581,6 +581,6 @@ export class YamlDocumenter {
581581

582582
private _deleteOldOutputFiles(): void {
583583
console.log('Deleting old output from ' + this._outputFolder);
584-
FileSystem.emptyFolder(this._outputFolder);
584+
FileSystem.ensureEmptyFolder(this._outputFolder);
585585
}
586586
}

apps/api-extractor/src/extractor/Extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class Extractor {
309309

310310
// Write the actual file
311311
FileSystem.writeFile(actualApiReviewPath, actualApiReviewContent, {
312-
ensureFolder: true
312+
ensureFolderExists: true
313313
});
314314

315315
// Compare it against the expected file

apps/api-extractor/src/generators/ApiJsonGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class ApiJsonGenerator extends AstItemVisitor {
4848
this.visit(context.package, this.jsonOutput);
4949

5050
// Write the output before validating the schema, so we can debug it
51-
JsonFile.save(this.jsonOutput, reportFilename, { ensureFolder: true });
51+
JsonFile.save(this.jsonOutput, reportFilename, { ensureFolderExists: true });
5252

5353
// Validate that the output conforms to our JSON schema
5454
ApiJsonFile.jsonSchema.validateObjectWithCallback(this.jsonOutput, (errorInfo: IJsonSchemaErrorInfo) => {

apps/api-extractor/src/generators/dtsRollup/DtsRollupGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class DtsRollupGenerator {
117117

118118
FileSystem.writeFile(dtsFilename, indentedWriter.toString(), {
119119
convertLineEndings: NewlineKind.CrLf,
120-
ensureFolder: true
120+
ensureFolderExists: true
121121
});
122122
}
123123

apps/rush-lib/src/api/ChangeFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class ChangeFile {
6666
public writeSync(): void {
6767
const filePath: string = this.generatePath();
6868
JsonFile.save(this._changeFileData, filePath, {
69-
ensureFolder: true
69+
ensureFolderExists: true
7070
});
7171
}
7272

apps/rush-lib/src/api/LastInstallFlag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class LastInstallFlag {
4545
*/
4646
public create(): void {
4747
JsonFile.save(this._state, this._path, {
48-
ensureFolder: true
48+
ensureFolderExists: true
4949
});
5050
}
5151

apps/rush-lib/src/api/test/LastInstallFlag.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const TEMP_DIR: string = path.join(__dirname, 'temp');
77

88
describe('LastInstallFlag', () => {
99
beforeEach(() => {
10-
FileSystem.emptyFolder(TEMP_DIR);
10+
FileSystem.ensureEmptyFolder(TEMP_DIR);
1111
});
1212

1313
afterEach(() => {
14-
FileSystem.emptyFolder(TEMP_DIR);
14+
FileSystem.ensureEmptyFolder(TEMP_DIR);
1515
});
1616

1717
it('can create and remove a flag in an empty directory', () => {

apps/rush-lib/src/cli/actions/ChangeAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ export class ChangeAction extends BaseRushAction {
462462
*/
463463
private _writeFile(fileName: string, output: string): void {
464464
FileSystem.writeFile(fileName, output, {
465-
ensureFolder: true
465+
ensureFolderExists: true
466466
});
467467
console.log('Created file: ' + fileName);
468468
}

apps/rush-lib/src/logic/InstallManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,17 +850,17 @@ export class InstallManager {
850850
// Before we start the network operation, record a failed state. If the process exits for some reason,
851851
// this will record the error. It will also update the timestamp to prevent other Rush instances
852852
// from attempting to update the file.
853-
JsonFile.save('error', lastCheckFile, { ensureFolder: true });
853+
JsonFile.save('error', lastCheckFile, { ensureFolderExists: true });
854854

855855
// For this check we use the official registry, not the private registry
856856
return this._queryIfReleaseIsPublished('https://registry.npmjs.org:443')
857857
.then((publishedRelease: boolean) => {
858858
// Cache the result
859-
JsonFile.save(publishedRelease, lastCheckFile, { ensureFolder: true });
859+
JsonFile.save(publishedRelease, lastCheckFile, { ensureFolderExists: true });
860860
return publishedRelease;
861861
})
862862
.catch((error: Error) => {
863-
JsonFile.save('error', lastCheckFile, { ensureFolder: true });
863+
JsonFile.save('error', lastCheckFile, { ensureFolderExists: true });
864864
return Promise.reject(error);
865865
});
866866
});

0 commit comments

Comments
 (0)