Skip to content

add --login for shell to support directly run from xcode #54

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

Closed
wants to merge 1 commit into from

Conversation

bestwnh
Copy link

@bestwnh bestwnh commented May 8, 2024

now WebIDLToSwift can directly run and debug from xcode

@@ -26,7 +26,7 @@ enum Shell {
// print("*** running script: \(script)")
let task = Process()
task.standardError = FileHandle.standardError
task.arguments = ["-c", script]
task.arguments = ["--login", "-c", script]
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we really need shell here just to run npm scripts.

Copy link
Author

Choose a reason for hiding this comment

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

If without this, the Xcode report can't find swiftformat. Same with the npm start.

Copy link
Member

@kateinoigakukun kateinoigakukun May 8, 2024

Choose a reason for hiding this comment

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

The right way to do it is telling PATH env var to Xcode scheme

Copy link
Author

@bestwnh bestwnh May 8, 2024

Choose a reason for hiding this comment

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

I am not familiar with environment variables, could you provide the values that need to be set?
And what is the down side of adding --login?

Copy link
Member

Choose a reason for hiding this comment

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

It's not yours fault but I think using shell here at all is not the right way. For example, what happens when your shell is not zsh but bash.

Copy link
Author

@bestwnh bestwnh May 8, 2024

Choose a reason for hiding this comment

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

Could you provide some key class or method names that can provide a better solution? I may try to make a PR to improve it.

@bestwnh bestwnh closed this May 8, 2024
@bestwnh bestwnh deleted the pr_support_xcode_run branch May 8, 2024 07:28
@bestwnh bestwnh restored the pr_support_xcode_run branch May 8, 2024 07:28
@bestwnh bestwnh reopened this May 8, 2024
@kateinoigakukun
Copy link
Member

Closing in favor of beec492

You can configure PATH in Xcode by
Screenshot 2024-05-08 at 16 44 48

@bestwnh bestwnh deleted the pr_support_xcode_run branch May 8, 2024 07:59
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