debugDir = "/debugExamples"
releaseDir = "/releaseExamples"
docDir="../../../mew_devdata/interfaceDoc/"
for path in `ls`
do
    if test -d $path
    then
        echo 'test package '$path
        cd $path
        ./test.sh
        cd ..
        rm -r $docDir$path$debugDir
        rm -r $docDir$path$releaseDir
        cp -r $path$debugDir $docDir$path
        cp -r $path$releaseDir $docDir$path
        sleep 3s
    fi
done

这里定义变量时加了空格,然后定义变量失败,$debugDir直接就为空,结果把我几个文件夹给删了,早上写的代码没有git add,全没了。。。

所以以后写脚本,运行的时候一定要先将代码保存

debugDir="/debugExamples"
releaseDir="/releaseExamples"
docDir="../../../mew_devdata/interfaceDoc/"
for path in `ls`
do
    if test -d $path
    then
        echo 'test package '$path
        cd $path
        ./test.sh
        cd ..
        rm -r $docDir$path$debugDir
        rm -r $docDir$path$releaseDir
        cp -r $path$debugDir $docDir$path
        cp -r $path$releaseDir $docDir$path
        sleep 3s
    fi
done

 

相关文章:

  • 2022-02-15
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-05-13
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
相关资源
相似解决方案