Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define array in env file for snapshot

Tags:

fastlane

In my projet I have several targets to build several variants of my app. In order to handle this with snapshot, I use environnements as described here: https://github.com/fastlane/fastlane/blob/master/docs/Advanced.md#environment-variables

It works fine for defining my scheme but I do not manage to use it for languages.

.env.first_environment

SCHEME = MyScheme

LANGUAGES = en-GB,es-ES

Snapfile

languages([
    ENV['LANGUAGES']
])

# The name of the scheme which contains the UI Tests
scheme ENV['SCHEME']

If I have only one language it works, but as soon as there is a comma in the env variable, I have some problems. When I launch fastlane I have:

+----------------------------+------------------------------+
|                Summary for snapshot 1.2.2                 |
+----------------------------+------------------------------+
| workspace                  | ./my_app.xcworkspace         |
| devices                    | ["iPhone 4s"]                |
| languages                  | ["en-GB,es-ES"]              |
| output_directory           | ./fastlane/Snapshots/MyScheme|
| ios_version                | 9.1                          |
| stop_after_first_error     | false                        |
| skip_open_summary          | false                        |
| clear_previous_screenshots | false                        |
| buildlog_path              | ~/Library/Logs/snapshot      |
| clean                      | false                        |
| scheme                     | My-Scheme                    |
+----------------------------+------------------------------+

For the language option I have "en-GB,es-ES" instead of "en-GB","es-ES".

like image 509
Quentin Avatar asked Jun 23 '26 03:06

Quentin


1 Answers

Answer from @AliSoftware:

In env file

...
LANGUAGES = "en-GB,es-ES"
...

In Snapfile

...
languages(
    ENV['LANGUAGES'].split(",")
)
...

Thanks.

like image 60
Quentin Avatar answered Jun 26 '26 21:06

Quentin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!