Skip to content

Commit 13df2a0

Browse files
Use sync version of fs.readFile
1 parent d169bc5 commit 13df2a0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/services/ios-project-service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,11 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
405405
public canUpdatePlatform(installedModuleDir: string): IFuture<boolean> {
406406
return (() => {
407407
let currentXcodeProjectFile = this.buildPathToCurrentXcodeProjectFile();
408-
let currentXcodeProjectFileContent = this.$fs.readFile(currentXcodeProjectFile).wait();
408+
let currentXcodeProjectFileContent = this.$fs.readFile(currentXcodeProjectFile);
409409

410410
let newXcodeProjectFile = this.buildPathToNewXcodeProjectFile(installedModuleDir);
411411
this.replaceFileContent(newXcodeProjectFile).wait();
412-
let newXcodeProjectFileContent = this.$fs.readFile(newXcodeProjectFile).wait();
412+
let newXcodeProjectFileContent = this.$fs.readFile(newXcodeProjectFile);
413413

414414
let contentIsTheSame = currentXcodeProjectFileContent.toString() === newXcodeProjectFileContent.toString();
415415
if(!contentIsTheSame) {
@@ -590,7 +590,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
590590
this.$logger.trace("Schedule merge plist at: " + plistPath);
591591
session.patch({
592592
name: path.relative(projectDir, plistPath),
593-
read: () => this.$fs.readFile(plistPath).wait().toString()
593+
read: () => this.$fs.readText(plistPath).wait()
594594
});
595595
};
596596

test/ios-project-service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ describe("iOSProjectService", () => {
234234

235235
assert.ok(plist);
236236

237-
let plistContent = fs.readFile(plist).wait().toString();
237+
let plistContent = fs.readText(plist).wait();
238238
// There may be better way to equal property lists
239239
assert.equal(plistContent, expectedPlistContent, "Mismatch in exportOptionsPlist content");
240240

@@ -444,7 +444,7 @@ describe("Static libraries support", () => {
444444

445445
iOSProjectService.generateModulemap(staticLibraryHeadersPath, libraryName);
446446
// Read the generated modulemap and verify it.
447-
let modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap")).wait();
447+
let modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap"));
448448
let headerCommands = _.map(headers, value => `header "${value}"`);
449449
let modulemapExpectation = `module ${libraryName} { explicit module ${libraryName} { ${headerCommands.join(" ")} } }`;
450450

@@ -456,7 +456,7 @@ describe("Static libraries support", () => {
456456

457457
let error: any;
458458
try {
459-
modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap")).wait();
459+
modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap"));
460460
} catch (err) {
461461
error = err;
462462
}

test/stubs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class FileSystemStub implements IFileSystem {
7272
return undefined;
7373
}
7474

75-
readFile(filename:string):IFuture<NodeBuffer> {
75+
readFile(filename:string): NodeBuffer | string {
7676
return undefined;
7777
}
7878

0 commit comments

Comments
 (0)