Skip to content

Commit 2591b76

Browse files
Use sync version of fs.unlink
1 parent a3c3fa3 commit 2591b76

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

lib/project-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class ProjectData implements IProjectData {
8484
this.$fs.writeJson(newProjectFilePath, newProjectData).wait();
8585
this.projectId = newProjectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE].id;
8686

87-
this.$fs.deleteFile(oldProjectFilePath).wait();
87+
this.$fs.deleteFile(oldProjectFilePath);
8888
} catch(err) {
8989
this.$logger.out("An error occurred while upgrading your project.");
9090
throw err;

lib/services/ios-project-service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
537537
public prepareAppResources(appResourcesDirectoryPath: string): IFuture<void> {
538538
return (() => {
539539
let platformFolder = path.join(appResourcesDirectoryPath, this.platformData.normalizedPlatformName);
540-
let filterFile = (filename: string) => this.$fs.deleteFile(path.join(platformFolder, filename)).wait();
540+
let filterFile = (filename: string) => this.$fs.deleteFile(path.join(platformFolder, filename));
541541

542542
filterFile(this.platformData.configurationFileName);
543543

@@ -912,7 +912,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
912912
let contentToRemove = this.buildPodfileContent(pluginPodFilePath, pluginPodFileContent);
913913
projectPodFileContent = helpers.stringReplaceAll(projectPodFileContent, contentToRemove, "");
914914
if (projectPodFileContent.trim() === `use_frameworks!${os.EOL}${os.EOL}target "${this.$projectData.projectName}" do${os.EOL}${os.EOL}end`) {
915-
this.$fs.deleteFile(this.projectPodFilePath).wait();
915+
this.$fs.deleteFile(this.projectPodFilePath);
916916
} else {
917917
this.$fs.writeFile(this.projectPodFilePath, projectPodFileContent).wait();
918918
}
@@ -931,7 +931,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
931931
let headers = _(headersFolderContents).filter(item => headersFilter(item, headersFolderPath)).value();
932932

933933
if (!headers.length) {
934-
this.$fs.deleteFile(path.join(headersFolderPath, "module.modulemap")).wait();
934+
this.$fs.deleteFile(path.join(headersFolderPath, "module.modulemap"));
935935
return;
936936
}
937937

@@ -957,7 +957,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
957957

958958
private mergeProjectXcconfigFiles(): IFuture<void> {
959959
return (() => {
960-
this.$fs.deleteFile(this.$options.release ? this.pluginsReleaseXcconfigFilePath : this.pluginsDebugXcconfigFilePath).wait();
960+
this.$fs.deleteFile(this.$options.release ? this.pluginsReleaseXcconfigFilePath : this.pluginsDebugXcconfigFilePath);
961961

962962
let allPlugins: IPluginData[] = (<IPluginsService>this.$injector.resolve("pluginsService")).getAllInstalledPlugins().wait();
963963
for (let plugin of allPlugins) {

lib/tools/node-modules/node-modules-dest-copy.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as path from "path";
22
import * as shelljs from "shelljs";
33
import * as constants from "../../constants";
44
import * as minimatch from "minimatch";
5-
import Future = require("fibers/future");
65

76
export interface ILocalDependencyData extends IDependencyData {
87
directory: string;
@@ -28,8 +27,7 @@ export class TnsModulesCopy {
2827
// Remove .ts files
2928
let allFiles = this.$fs.enumerateFilesInDirectorySync(tnsCoreModulesResourcePath);
3029
let matchPattern = this.$options.release ? "**/*.ts" : "**/*.d.ts";
31-
let deleteFilesFutures = allFiles.filter(file => minimatch(file, matchPattern, { nocase: true })).map(file => this.$fs.deleteFile(file));
32-
Future.wait(deleteFilesFutures);
30+
allFiles.filter(file => minimatch(file, matchPattern, { nocase: true })).map(file => this.$fs.deleteFile(file));
3331

3432
shelljs.rm("-rf", path.join(tnsCoreModulesResourcePath, "node_modules"));
3533

test/ios-project-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ describe("Static libraries support", () => {
451451
assert.equal(modulemap, modulemapExpectation);
452452

453453
// Delete all header files. And try to regenerate modulemap.
454-
_.each(headers, header => { fs.deleteFile(path.join(staticLibraryHeadersPath, header)).wait(); });
454+
_.each(headers, header => { fs.deleteFile(path.join(staticLibraryHeadersPath, header)); });
455455
iOSProjectService.generateModulemap(staticLibraryHeadersPath, libraryName);
456456

457457
let error: any;

test/stubs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class FileSystemStub implements IFileSystem {
4848
return true;
4949
}
5050

51-
deleteFile(path:string):IFuture<void> {
51+
deleteFile(path:string): void {
5252
return undefined;
5353
}
5454

0 commit comments

Comments
 (0)