Browse Source

bug fix

dev
thuhole 5 years ago
parent
commit
faed990d5a
  1. 6
      travis_deploy.sh

6
travis_deploy.sh

@ -20,8 +20,8 @@ git remote rm origin
git remote add origin https://thuhole:"${GH_TOKEN}"@github.com/thuhole/webhole.git git remote add origin https://thuhole:"${GH_TOKEN}"@github.com/thuhole/webhole.git
CI=false PUBLIC_URL=$CDN_URL REACT_APP_BUILD_INFO=$VERSION_NUMBER npm run build CI=false PUBLIC_URL=$CDN_URL REACT_APP_BUILD_INFO=$VERSION_NUMBER npm run build
#额,这里用了个骚操作来修复Service Worker在Precache CDN内容的时候index.html返回content-type text/plain的问题 #额,这里用了个骚操作来修复Service Worker在Precache CDN内容的时候index.html返回content-type text/plain的问题
sed -i 's|//cdn.jsdelivr.net/gh/thuhole/webhole@'"$DEPLOY_BRANCH"'/index.html|./index.html|g' build/*-* sed -i 's|https://cdn.jsdelivr.net/gh/thuhole/webhole@'"$DEPLOY_BRANCH"'/index.html|./index.html|g' build/*-*
sed -i 's|//cdn.jsdelivr.net/gh/thuhole/webhole@'"$DEPLOY_BRANCH"'/service-worker.js|./service-worker.js|g' build/*-* sed -i 's|https://cdn.jsdelivr.net/gh/thuhole/webhole@'"$DEPLOY_BRANCH"'/service-worker.js|./service-worker.js|g' build/*-*
sed -i 's|"//cdn.jsdelivr.net/gh/thuhole/webhole@'"$DEPLOY_BRANCH"'","/service-worker.js"|".","/service-worker.js"|' build/static/js/*.js sed -i 's|"https://cdn.jsdelivr.net/gh/thuhole/webhole@'"$DEPLOY_BRANCH"'","/service-worker.js"|".","/service-worker.js"|' build/static/js/*.js
sed -i 's|storage.googleapis.com/workbox-cdn/releases/4.3.1|cdn.jsdelivr.net/npm/[email protected]/workbox|g' build/service-worker.js sed -i 's|storage.googleapis.com/workbox-cdn/releases/4.3.1|cdn.jsdelivr.net/npm/[email protected]/workbox|g' build/service-worker.js
npm run deploy npm run deploy
Loading…
Cancel
Save