Stealing dist.sh from @fanzeyi.