Fastlane params issue

Description of the issues
It seems that it can’t properly handle spaced in the fastlane params.
I tried to run a lane with an environment variable that contains a space (example: $APP_NAME = “My App”) as the following code:

fastlane [lane] app_name:$APP_NAME

Also tried:
fastlane [lane] app_name:"$APP_NAME"
fastlane [lane] app_name:’$APP_NAME’
fastlane [lane] app_name:"${APP_NAME}"

but app_name is always trimmed.

Environment:
Bitrise: Xcode 8.2, on macOS 10.12 (Sierra)
Fastlane step version: 2.2.0 (latest)
Fastlane gem version: 2.7.0

Thanks for the report, @godreikrisztian will release a new version of the fastlane step today which will fix this (the case when your fastlane params include whitespace characters).

@viktorbenei thank you :slight_smile:

1 Like

I just checked and @godreikrisztian just finished the new version and should be shared soon! :wink:

Hi @vscafuto,
we released a new version 2.3.0, it will shell split the lane input’s value, to properly pass these params to fastlane command.

The new version will be available in the steplib in ~20min.

Thanks for the report!

It was just released - should be available now :wink:

Thank you @godreikrisztian @viktorbenei :slight_smile:

1 Like

I’ve the same problem with fastlane 2.3.7 (maybe a regression?) can you check it please?

Can you please include the log here? Including the step’s header and footer.

In my workflow, I set this environment variable:

ENV VARIABLE:

  • envman add --key APP_DISPLAY_NAME --value Qicraft Norway

FASTLANE STEP
ci_script app_name:$APP_DISPLAY_NAME bundle_identifier:$APP_BUNDLE_ID app_version:$APP_VERSION app_build:$APP_BUILD sku_name:$APP_SKU_NAME output_path:$MWAPP_PROJECT_PATH deploy:TestFlight

(I also tried app_name: “$APP_DISPLAY_NAME” but it doesn’t work)

LOG:

±-----------------------------------------------------------------------------+
| (4) fastlane@2.3.7 |
±-----------------------------------------------------------------------------+
| id: fastlane |
| version: 2.3.7 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2017-03-22T09:13:16-07:00 |
±-----------------------------------------------------------------------------+
| |
e[34mINFOe[0m[09:13:16] * e[32;1m[OK]e[0m Step dependency (go) installed, available.

e[34;1mConfigs:e[0m

  • WorkDir: /Users/vagrant/git
  • Lane: ci_script app_name:Qicraft bundle_identifier:com.technogym.mywellness.qicraftnorway app_version:4.0.0 app_build:4003 sku_name:qicraftnorway1.0 output_path:/Users/vagrant/git/Mywellness deploy:TestFlight
  • UpdateFastlane: true

e[34;1mExpand WorkDire[0m
e[32;1mExpanded WorkDir: /Users/vagrant/gite[0m

e[34;1mDetermine desired Fastlane versione[0m
Checking Gemfile.lock (/Users/vagrant/git/Gemfile.lock) for fastlane gem
Gemfile.lock does not exist

e[34;1mUpdate system installed Fastlanee[0m
e[32;1m$ gem “install” “fastlane” "–no-document"e[0m
Successfully installed tty-screen-0.5.0
Successfully installed fastlane-2.22.0
2 gems installed

e[34;1mFastlane version:e[0m
e[32;1m$ fastlane "–version"e[0m
fastlane installation at path:
/usr/local/lib/ruby/gems/2.3.0/gems/fastlane-2.22.0/bin/fastlane

fastlane 2.22.0

e[34;1mRun Fastlanee[0m
e[32;1m$ fastlane “ci_script” “app_name:Qicraft” “bundle_identifier:com.technogym.mywellness.qicraftnorway” “app_version:4.0.0” “app_build:4003” “sku_name:qicraftnorway1.0” “output_path:/Users/vagrant/git/Mywellness” "deploy:TestFlight"e[0m
[09:13:27]: e[32m-------------------------------------------------e[0m
[09:13:27]: e[32m— Step: Verifying required fastlane version —e[0m
[09:13:27]: e[32m-------------------------------------------------e[0m
[09:13:27]: Your fastlane version 2.22.0 matches the minimum requirement of 1.36.0 :white_check_mark:
[09:13:27]: e[32m------------------------------e[0m
[09:13:27]: e[32m— Step: default_platform —e[0m
[09:13:27]: e[32m------------------------------e[0m
[09:13:27]: e[32mDriving the lane ‘ios ci_script’ :rocket:e[0m
[09:13:27]: e[32m-----------------------------------------------------e[0m
[09:13:27]: e[32m— Step: Switch to ios manage_prov_profiles lane —e[0m
[09:13:27]: e[32m-----------------------------------------------------e[0m
[09:13:27]: Cruising over to lane ‘ios manage_prov_profiles’ :oncoming_taxi:
[09:13:27]: e[32m-------------------e[0m
[09:13:27]: e[32m— Step: match —e[0m
[09:13:27]: e[32m-------------------e[0m
[09:13:27]: e[32mSuccessfully loaded ‘/Users/vagrant/git/fastlane/Matchfile’ :page_facing_up:e[0m

±---------------------±-----------------------------------------------------+
| Detected Values from ‘./fastlane/Matchfile’ |
±---------------------±-----------------------------------------------------+
| git_url | git@bitbucket.org:mywellnesscloud/fastlane-match.git |
±---------------------±-----------------------------------------------------+

As you can see, the app_name parameter is not Qicraft Norway but only Qicraft

Hi @vscafuto could you please try to export the APP_DISPLAY_NAME env var

this way:

envman add --key APP_DISPLAY_NAME --value "Qicraft Norway"

1 Like

Workflow:
envman add --key APP_DISPLAY_NAME --value “$APP_DISPLAY_NAME”

Log:
envman add --key APP_DISPLAY_NAME --value ‘Qicraft Norway’

Run Fastlane
$ fastlane “ci_script” “app_name:Qicraft” “Norway” “bundle_identifier:com.technogym.mywellness.qicraftnorway” “app_version:4.0.0” “app_build:4004” “sku_name:qicraftnorway1.0” “output_path:/Users/vagrant/git/Mywellness” “deploy:TestFlight”
[04:00:52]: -------------------------------------------------
[04:00:52]: — Step: Verifying required fastlane version —
[04:00:52]: -------------------------------------------------
[04:00:52]: Your fastlane version 2.22.0 matches the minimum requirement of 1.36.0 :white_check_mark:
[04:00:52]: ------------------------------
[04:00:52]: — Step: default_platform —
[04:00:52]: ------------------------------
±-----------------±------+
| Lane Context |
±-----------------±------+
| DEFAULT_PLATFORM | ios |
±-----------------±------+
[04:00:52]: Could not find lane ‘ci_script Norway’. Available lanes: ios test, ios beta, ios deploy, ios ci_script, ios produce_screenshots

It doesn’t work. It trims the name in two strings

@vscafuto could you please share your bitrise.yml? If it contains secret informations please send us a message on bitrise-on-site chat.

Actually I think only the - fastlane: step section would be enough - or just send the build’s URL to us in email/onsite chat @vscafuto

Got the logs and config - the issue is with the fastlane step’s lane param, you have to quote your params if those include spaces, just like in Bash. Instead of:

- fastlane@2.3.7:
        inputs:
        - lane: ci_script app_name:$APP_DISPLAY_NAME bundle_identifier:$APP_BUNDLE_ID
            app_version:$APP_VERSION ...

Should be:

- fastlane@2.3.7:
        inputs:
        - lane: ci_script "app_name:$APP_DISPLAY_NAME" "bundle_identifier:$APP_BUNDLE_ID"
            "app_version:$APP_VERSION" ...

It works! Thank you :slight_smile:

1 Like