refactor the code about compile.sh