[PLAT-3579] Fix script generation