Add sharding support for scripts