Couldn't we use path.resolve for this?