The argument passed to the function is in $1; $0 contains `-bash`. Before this fix, IDF_PATH would be set to $PWD instead of the correct path.
JIRA IDF-790