Use the same method for finding the basedir as our other code.

Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>