它在MAC上工作正常,但在Travis-Cli上有问题。这是我的shell脚本。我不知道出了什么问题
sourcePath=$basepath'/docs/.vuepress/dist/'
function fileForEach() {
for file in `ls $1`
do
if [ -d $1"/"$file ]
then
if [ -n "`find $1$file -maxdepth 1 -name '*.html'`" ];
then
# echo $1$file"/"*.html
sed -i '' '/<html/a\
<script type="text/javascript" src="https://s9.cnzz.com/z_stat.php?id=1277950578&web_id=1277950578"></script><style>body>a{display:none!important;}</style>' $1$file"/"*.html
fi
fi
done
}
npm run build
fileForEach $sourcePath
在Travis中,错误消息如下:
sed: can't read /<html/a\
<script type="text/javascript" src="https://s9.cnzz.com/z_stat.php?id=1277950578&web_id=1277950578"></script>
<style>body>a{display:none!important;}</style>: No such file or directory
The command "bash ./deploy.sh" exited with 2.
有人看到这里有什么问题吗?