Skip to content

Use spawn wherever possible #1458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
let project = this.createPbxProj();
let frameworkName = path.basename(frameworkPath, path.extname(frameworkPath));
let frameworkBinaryPath = path.join(frameworkPath, frameworkName);
let isDynamic = _.contains(this.$childProcess.exec(`otool -Vh ${frameworkBinaryPath}`).wait(), " DYLIB ");
let isDynamic = _.contains(this.$childProcess.spawnFromEvent("otool", ["-Vh", frameworkBinaryPath], "close").wait().stdout, " DYLIB ");

let frameworkAddOptions: xcode.Options = { customFramework: true };

Expand Down Expand Up @@ -577,7 +577,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
this.$errors.failWithoutHelp("The bundle at %s does not contain an Info.plist file.", libraryPath);
}

let packageType = this.$childProcess.exec(`/usr/libexec/PlistBuddy -c "Print :CFBundlePackageType" "${infoPlistPath}"`).wait().trim();
let packageType = this.$childProcess.spawnFromEvent("/usr/libexec/PlistBuddy", ["-c", "Print :CFBundlePackageType", infoPlistPath], "close").wait().stdout.trim();
if (packageType !== "FMWK") {
this.$errors.failWithoutHelp("The bundle at %s does not appear to be a dynamic framework.", libraryPath);
}
Expand Down Expand Up @@ -762,7 +762,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
this.$fs.writeFile(projectFile, "").wait();
}

let mergeScript = `require 'xcodeproj'; Xcodeproj::Config.new('${projectFile}').merge(Xcodeproj::Config.new('${pluginFile}')).save_as(Pathname.new('${projectFile}'))`;
let escapedProjectFile = projectFile.replace(/'/g, "\\'"),
escapedPluginFile = pluginFile.replace(/'/g, "\\'"),
mergeScript = `require 'xcodeproj'; Xcodeproj::Config.new('${escapedProjectFile}').merge(Xcodeproj::Config.new('${escapedPluginFile}')).save_as(Pathname.new('${escapedProjectFile}'))`;
this.$childProcess.exec(`ruby -e "${mergeScript}"`).wait();
}).future<void>()();
}
Expand Down