0

When I run swiftgen in Terminal the command is recognized. When a script in a xcode build runs swiftgen it says command not found. How are the two environments different, and how can I get them in sync?

I tried different shells in both and they always worked in Terminal but not in xcode.

Marty
  • 5,926
  • 9
  • 53
  • 91
  • Obviously the values of PATH are differnt in both. Are you really running POSIX shell in both environments? – user1934428 Dec 07 '22 at 07:50
  • What does this have to do with FreeBSD? – Rob Dec 07 '22 at 08:05
  • @Rob: I think because it's run on MacOS, and that in turn is AFIK based on FreeBSD. However, the tag _macos_ would be more appropriate of course. – user1934428 Dec 07 '22 at 08:11
  • 1
    using a shell, `ps -e` will show you the environment of your `xcode` instance, so you will see what happens. `FreeBSD` use `/usr/local` as a prefix for 3rd party apps, perhaps add this path to your `xcode` configuration panel. Also in shell, `which swiftgen` will show you its real path. Flag `macos` tag with your question in order to get answer from the macos specialists. – Valery S. Dec 07 '22 at 09:43
  • @user1934428 obvious to you (rep 16k+), or to OP (rep 9)...? What would be the best way for him to check? – Marty Dec 12 '22 at 16:38
  • @Marty: Even with zero reputation, we know that _command not found_ comes from the problem that the command is found via the PATH (this is really one of the basics), and I can compare the PATHes by simply doing `echo $PATH` in both cases and see whether they are different. This is what I meant from _being obvious_. Of course, finding out then **why** they are different, might need a bit of work.. – user1934428 Dec 13 '22 at 07:44
  • _I tried different shells_ is a bit vague, in particular if you don't explain what shells you tried, how you "tried" them, and how you did the setup for them. You also did not explain how the shells are started in the both environment; it's usually a difference when you run a login-shell or a non-login-shell. BTW, if we are now steering towards "configuring xcode", and not "programming the startup files for a shell", this question should be asked at [AskDifferent](https://apple.stackexchange.com/). Stackoverflow is for discussing programming problems. – user1934428 Dec 13 '22 at 07:48
  • @user1934428 thanks but i totally forgot about ChatGPT. It was able to help the beginner who has less than a year experience in the industry, without making him feel like he's an idiot for asking a question in not exactly the right way on exactly the right SE site. He's too scared to even reply to you. You'd be better off not answering beginners. And learning some of those "soft skills" you've heard about. – Marty Dec 20 '22 at 03:51
  • @Marty: I think [this|(https://meta.stackexchange.com/questions/152066/are-beginner-questions-allowed-on-stack-overflow) thread is related to what you want to say here (see in particular the accepted answer in that thread). Beginners **are** welcome at SO, provided that the question is about programming, and that they describe their own to solve it before asking here. Perhaps [su| would be a better site for this question, but even there, I think they would expect the OP to do some research on his own (at least google the error message) before asking. – user1934428 Dec 24 '22 at 13:35

0 Answers0