6

I'm developing a cocoapod (MySDK in the screenshot below) that runs a script as part of its installation. I need to pass the name of the main executable (i.e. SecThree) to that script, i.e. $FOO below:

enter image description here

I thought I could use $PRODUCT_NAME, $TARGET_NAME, or $EXECUTABLE_NAME, but of course these are MySDK when run within the MySDK target.

How could I resolve the name of the main target from within a script in its dependencies?

2
  • 1
    Did you figured it out? Commented May 23, 2020 at 12:22
  • Were you able to get the solution? Commented Feb 22, 2021 at 6:09

1 Answer 1

1

I don't think there is a built-in way, but an easy work-around is to just create a variable before calling sh myscript.sh --app-name=${FOO}:

TARGET_NAME="MySDK"

sh myscript.sh --app-name=${FOO}

Now you can access $TARGET_NAME inside myscript.sh

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.