title: AWS CodeDeploy hooks scripts execution location
body: <p>I am currently using CodeDeploy for a NodeJS application of mine and I just have 1 burning question, is there a way to instruct say, my BeforeInstall script to run on the revision root instead of the root directory of my Linux OS?</p>
  
  <p>For instance, the BeforeInstall hook script of mine may looks like this:</p>
  
  <pre><code>#!/bin/bash
  echo "Current directory: "
  echo $PWD
  echo `ls`
  # Do actual stuff here
  </code></pre>
  
  <p>By looking at the log it seemed to me that the script is ran on / (OS root), how do I instruct it to run on the revision root? I know I can CD into <code>/opt/codedeploy-agent/deployment-root/app-id/deployment-id</code> but it just seemed like a hassle to me to retrieve the app id and deployment id every time.</p>