more like @substack's mkdirp