Wait when editing the project (#1356)

* Wait when editing the project

* Update CHANGELOG

Co-authored-by: Pedro Piñera <pedro@ppinera.es>
This commit is contained in:
Pedro Piñera Buendía 2020-05-18 17:47:18 +02:00 committed by GitHub
parent 04e3ca91a1
commit 351982105a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

@ -11,7 +11,8 @@ Please, check out guidelines: https://keepachangelog.com/en/1.0.0/
### Fixed
- Storing the cloud credentials failed because the Keychain syncing was enabled [#1355](https://github.com/tuist/tuist/pull/1355) by [@pepibumur](https://github.com/pepibumur)
- Storing the cloud credentials failed because the Keychain syncing was enabled [#1355](https://github.com/tuist/tuist/pull/1355) by [@pepibumur](https://github.com/pepibumur).
- `tuist edit` doesn't wait while the user edits the project in Xcode [#1650](https://github.com/Shopify/react-native/pull/1650) by [@pepibumur](https://github.com/pepibumur).
### Changed

View File

@ -27,7 +27,7 @@ final class EditService {
exit(0)
}
logger.pretty("Opening Xcode to edit the project. Press \(.keystroke("CTRL + C")) once you are done editing")
try opener.open(path: xcodeprojPath)
try opener.open(path: xcodeprojPath, wait: true)
} else {
logger.notice("Xcode project generated at \(xcodeprojPath.pathString)", metadata: .success)
}

View File

@ -27,6 +27,7 @@ enum OpeningError: FatalError, Equatable {
}
public protocol Opening: AnyObject {
func open(path: AbsolutePath, wait: Bool) throws
func open(path: AbsolutePath) throws
func open(url: URL) throws
func open(target: String, wait: Bool) throws
@ -37,11 +38,15 @@ public class Opener: Opening {
// MARK: - Opening
public func open(path: AbsolutePath) throws {
public func open(path: AbsolutePath, wait: Bool) throws {
if !FileHandler.shared.exists(path) {
throw OpeningError.notFound(path)
}
try open(target: path.pathString, wait: false)
try open(target: path.pathString, wait: wait)
}
public func open(path: AbsolutePath) throws {
try open(path: path, wait: false)
}
public func open(url: URL) throws {

View File

@ -13,6 +13,10 @@ public final class MockOpener: Opening {
if let openStub = openStub { throw openStub }
}
public func open(path: AbsolutePath, wait: Bool) throws {
try open(target: path.pathString, wait: wait)
}
public func open(path: AbsolutePath) throws {
try open(target: path.pathString, wait: false)
}