Skip to content
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

Use SwiftCLI #29

Merged
merged 4 commits into from
Jun 1, 2018
Merged

Use SwiftCLI #29

merged 4 commits into from
Jun 1, 2018

Conversation

jakeheis
Copy link
Contributor

This is a possible fix to #28. In most places I tried to make the fewest changes possible so that this PR wasn't too unwieldy. Most changes are relatively straight forward, but FunctionParser.getParams needed to be largely rewritten.

Bugs fixed:

  • SIGINT will now be forwarded to subprocesses
  • Input will now be handled correctly in subprocesses launched with beak run
  • nil is now a valid value for optional function parameters

Public API changed:

  • public func execute(arguments: [String]) throws -> public func execute(arguments: [String]? = nil) -> Int32

I'd also to like to re-emphasize that I am not trying to force SwiftCLI on this project in any way, this is just one solution to #28. If you decide to not use SwiftCLI I'd be happy to open a new PR which fixes the SIGINT problem with SwiftShell!

Copy link
Owner

@yonaskolb yonaskolb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @jakeheis, thank you! I'm totally happy using SwiftCLI and removing 2 other dependencies.

_ = try capture("swift", arguments: ["package", "generate-xcodeproj"], directory: packagePath.string)
} catch let error as CaptureError {
stdout <<< error.captured.rawStdout
stdout <<< error.captured.rawStderr
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this go to stderr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

_ = try capture("swift", arguments: ["build", "--disable-sandbox"], directory: packagePath.string)
} catch let error as CaptureError {
stdout <<< error.captured.rawStdout
stdout <<< error.captured.rawStderr
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be stderr?

@yonaskolb
Copy link
Owner

🎉

@yonaskolb yonaskolb merged commit b540e66 into yonaskolb:master Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants