add custom base directory support

Signed-off-by: Ahmad Shah Hafizan Hamidin <ahmadshahhafizan@gmail.com>
merge conflict