Add stagedir support