calculate base path
refactor
moved runifFileNotExists test to new file