Optimized the post build script and fixed the root files not being committed