Deployment steps create log file, how to cat / echo log file in after_deploy step?

In my deployment script, an output file was generated.
However, in after_deploy, all attempts at echoing that file returns blank.

  - ls
  - cat output.log

ls returns that the file is indeed there
cat output.log returns nothing.


So in my deployment script I have something like

- provider: script
  script: now --stuff...  > NOW_URL.log && cat NOW_URL.log && node slack-notifications/now-alias.js $(< NOW_URL.log)

and in after_deploy i have

after_deploy: echo $(cat NOW_URL.log)
  1. why can’t i have just cat NOW_URL.log in after_deploy and need to wrap my call with echo $(…) ?
  2. during the deploy script, the second command cat NOW_URL.log works as intended and dump out a URL for my deployment, however, the code in my third command is acting very strangely
node slack-notifications/now-alias.js $(cat NOW_URL.log)

the $(cat NOW_URL.log) was executed BEFORE the actual deployment step and triggered an error about NOW_URL.log is missing (because it was only created in part 1 of my deployment script), and because of that, my node script in my 3rd deployment command received nothing as part of the argument…

Is there any reason why my $(cat NOW_URL.log) was executed out of order?

Please include the build log URL to indicate the issue. Thanks.

@BanzaiMan here is one