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 sub instead of gsub #225

Merged
merged 1 commit into from
Jan 24, 2015
Merged

use sub instead of gsub #225

merged 1 commit into from
Jan 24, 2015

Conversation

almassapargali
Copy link
Contributor

Hello,
Since we're printing one attribute at a line I wanted to propose change gsub with sub (hence name: sub('gsub', 'sub') 😄). The reason is I have pre-action scripts on my scheme like this:
screen shot 2014-12-22 at 3 29 08 pm
Which saved on xml like this:

         <ExecutionAction
            ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
            <ActionContent
               title = "Run Script"
               scriptText = "// getting json file name&#10;BUNDLE_ID=$(/usr/libexec/PlistBuddy -c &quot;Print :CFBundleIdentifier&quot; &quot;${INFOPLIST_FILE}&quot;)&#10;JSON_FILE_NAME=&quot;config.json&quot;&#10;&#10;// getting json remote url&#10;JSON_REMOTE_URL=&quot;http://website.com/v1/${BUNDLE_ID}/config&quot;&#10;&#10;// local json path&#10;JSON_PATH=&quot;${PROJECT_DIR}/app/${JSON_FILE_NAME}&quot;&#10;&#10;// loading&#10;curl ${JSON_REMOTE_URL} &gt; ${JSON_PATH}&#10;"
               shellToInvoke = "/bin/sh">
            </ActionContent>
         </ExecutionAction>

And after saving scheme with XMLFormatter it changes all '=' with ' = ', so my scripts no longer works.

I think we're ok with changing only first occurrence of '='.

@segiddins
Copy link
Member

Ping to the rest of the core team?

@almassapargali
Copy link
Contributor Author

I don't know if you should, should I? Feel free to ping anyway.

segiddins added a commit that referenced this pull request Jan 24, 2015
@segiddins segiddins merged commit ff2c16c into CocoaPods:master Jan 24, 2015
@kylef
Copy link
Contributor

kylef commented Jan 24, 2015

I think this makes sense, we just want to add spaces either side of the first = and it should be sub not gsub.

@almassapargali Can you add an entry into the CHANGELOG (CHANGELOG.md in the root of the repository).

almassapargali added a commit to almassapargali/Xcodeproj that referenced this pull request Jan 24, 2015
orta added a commit that referenced this pull request Jan 24, 2015
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.

3 participants