{"action":"created","issue":{"url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs/issues/28","repository_url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs","labels_url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs/issues/28/comments","events_url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs/issues/28/events","html_url":"https://github.com/cirruslabs/cirrus-ci-docs/issues/28","id":346639869,"node_id":"MDU6SXNzdWUzNDY2Mzk4Njk=","number":28,"title":"How to conditionally run a script?","user":{"login":"DanTup","id":1078012,"node_id":"MDQ6VXNlcjEwNzgwMTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1078012?v=4","gravatar_id":"","url":"https://api.github.com/users/DanTup","html_url":"https://github.com/DanTup","followers_url":"https://api.github.com/users/DanTup/followers","following_url":"https://api.github.com/users/DanTup/following{/other_user}","gists_url":"https://api.github.com/users/DanTup/gists{/gist_id}","starred_url":"https://api.github.com/users/DanTup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanTup/subscriptions","organizations_url":"https://api.github.com/users/DanTup/orgs","repos_url":"https://api.github.com/users/DanTup/repos","events_url":"https://api.github.com/users/DanTup/events{/privacy}","received_events_url":"https://api.github.com/users/DanTup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-01T15:02:36Z","updated_at":"2018-08-01T16:11:39Z","closed_at":null,"author_association":"NONE","body":"In my Travis scripts I had some commands that were conditional, like this:\r\n\r\n```bash\r\nif [[ \"$OS\" == \"linux\" ]]; then\r\n  apt-get -y install libsecret-1-dev libstdc++6 gcc-4.8 xvfb\r\n  export CXX=\"g++-4.8\" CC=\"gcc-4.8\" DISPLAY=:99.0;\r\n  sh -e Xvfb;\r\nfi;\r\n```\r\n\r\nWhen I try something like this on Cirrus, I get:\r\n\r\n> /tmp/scriptsXXX.sh: 3: /tmp/scriptsXXX.sh: [[: not found\r\n\r\nI see you have conditions on tasks, but in this case I just want it on a few scripts (currently I'm trying to share the same task on Linux + macOS rather than duplicating all the steps)."},"comment":{"url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs/issues/comments/409630165","html_url":"https://github.com/cirruslabs/cirrus-ci-docs/issues/28#issuecomment-409630165","issue_url":"https://api.github.com/repos/cirruslabs/cirrus-ci-docs/issues/28","id":409630165,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTYzMDE2NQ==","user":{"login":"fkorotkov","id":989066,"node_id":"MDQ6VXNlcjk4OTA2Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/989066?v=4","gravatar_id":"","url":"https://api.github.com/users/fkorotkov","html_url":"https://github.com/fkorotkov","followers_url":"https://api.github.com/users/fkorotkov/followers","following_url":"https://api.github.com/users/fkorotkov/following{/other_user}","gists_url":"https://api.github.com/users/fkorotkov/gists{/gist_id}","starred_url":"https://api.github.com/users/fkorotkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkorotkov/subscriptions","organizations_url":"https://api.github.com/users/fkorotkov/orgs","repos_url":"https://api.github.com/users/fkorotkov/repos","events_url":"https://api.github.com/users/fkorotkov/events{/privacy}","received_events_url":"https://api.github.com/users/fkorotkov/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T16:11:39Z","updated_at":"2018-08-01T16:11:39Z","author_association":"CONTRIBUTOR","body":"@DanTup I can't repro `[[: not found` error. Do you have a link to a task?"}}
{"actor":{"display_login":"fkorotkov"}}