Skip to content

Commit

Permalink
fix: 🐛 ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaha committed Jul 9, 2020
1 parent b91a06b commit b0a0d22
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project_name: zzz
builds:
- main: ./main.go
ldflags:
- -s -w -X 'github.com/sohaha/zzz/util.BuildTime={{.Date}}' -X 'github.com/sohaha/zzz/util.Version={{.Version}} -X github.com/sohaha/zzz/util.BuildGoVersion={{.Env.GOVERSION}}'
- -s -w -X 'github.com/sohaha/zzz/util.BuildTime={{.Date}}' -X 'github.com/sohaha/zzz/util.Version={{.Version}}'
goos:
- windows
- linux
Expand All @@ -15,7 +15,6 @@ builds:
ignore:
env:
- CGO_ENABLED=0
- GOVERSION_NR=$(go version | awk '{print $3;}')
- GO111MODULE=on

archives:
Expand Down
1 change: 1 addition & 0 deletions app/watch/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func httpEntrance(c *znet.Context) {
method := c.Request.Method
urlPath := c.Request.URL.Path

c.SetHeader("cache-control", "no-store")
if urlPath == "/" || urlPath == "" {
urlPath = "/index.html"
}
Expand Down
4 changes: 2 additions & 2 deletions app/watch/httpUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: seekwe
* @Date: 2020-07-03 19:28:53
* @Last Modified by:: seekwe
* @Last Modified time: 2020-07-06 14:03:07
* @Last Modified time: 2020-07-08 19:34:07
*/
package watch

Expand All @@ -13,4 +13,4 @@ a=function(n){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===n)return void locati
n){!0===n?n=SpaResource.mod[e]||[]:SpaResource.mod[e]=n,r.mod[e]=n;var o=r.sta,a={},i=!0,c=!1,f=void 0;try{for(var u,l=n[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var s=u.value;s=t(s);var d=o[s]||[];d.indexOf(e)>=0||(d.push(e),a[s]=d)}}catch(e){c=!0,f=e}finally{try{!i&&l.return&&l.return()}finally{if(c)throw f}}Object.assign(o,a),Object.assign(SpaResource.sta,a)},f=function(){(_SpaForChildren=function(e,n){for(var o=e.length,a=0;a<o;a++){var r=e[a];r&&n&&setTimeout(function(){r.$vnode.context.$forceUpdate()}),_SpaForChildren(r.$children,n)}})(Spa.vue.$children,1)};window._SpaModGet=function(e,n){!1===n?i(e):c(e,n)},window.Spa?function e(){try{var n=location.host;zwatchWs=new WebSocket("ws://"+n+"/"),zwatchWs.onopen=function(e){},zwatchWs.onmessage=function(e){var n=JSON.parse(e.data);if(console.log("update: ",n.Name),n.Name){0!==n.Name.indexOf("/")&&(n.Name="/"+n.Name);var r=Spa.baseUrl;0!==r.indexOf("/")&&(r="/"+r);var t=new RegExp(r+"(.*)"+Spa.suffix,"g").exec(n.Name);if(t)Spa.loadMod(t[1],!0).then(function(){f()});else{var i=SpaResource.sta[n.Name];i?(i=i.map(function(e){return e.replace(/_/g,"/")}),Spa.loadMod(i,!0).then(function(){f()})):(a(n.Name),o(n.Name))}}},zwatchWs.onclose=function(n){console.warn("Disconnect from zwatch."),setTimeout(function(){e()},300)}}catch(e){}}():function(){` + webJs + `}()}();
`

const vueHotReload = `!function(){var n=function(){function n(n){return n?(h.href=n,h.pathname):""}function e(n){var e=n.lastIndexOf(".");return-1!=e?n.substring(e+1,n.length).toLowerCase():""}function o(n,e){if(e.functional){var o=e.render;e.render=function(e,t){var r=l[n].instances;return t&&r.indexOf(t.parent)<0&&r.push(t.parent),o(e,t)}}else t(e,p,function(){var e=l[n];e.Ctor||(e.Ctor=this.constructor),e.instances.push(this)}),t(e,"beforeDestroy",function(){var e=l[n].instances;e.splice(e.indexOf(this),1)})}function t(n,e,o){var t=n[e];n[e]=t?Array.isArray(t)?t.concat(o):[t,o]:[o]}function r(n){return function(e,o){try{n(e,o)}catch(n){console.error(n),console.warn("Something went wrong during Vue component hot-reload. Full reload required.")}}}function i(n,e){for(var o in n)o in e||delete n[o];for(var t in e)n[t]=e[t]}function c(n){if(n._u){var e=n._u;return n._u=function(n){try{return e(n,!0)}catch(o){return e(n,null,!0)}},function(){n._u=e}}}var a,s,u={},l=Object.create(null);window.__VUE_HOT_MAP__=l;var f=!1,d=!1,p="beforeCreate";window.VueRun.debug=u;var v={},h=document.createElement("a"),w=function(){try{var o=location.host;zwatchWs=new WebSocket("ws://"+o+"/"),zwatchWs.onopen=function(n){},zwatchWs.onmessage=function(o){var t=JSON.parse(o.data),r="/"+t.Name,i=e(r);switch(console.log("update: ",r),i){case"vue":VueRun.hotReload(r),console.log("hotReload: ",r);break;case"html":var c=location.pathname;"/"==c&&(c="index.html"),r===c&&location.reload();break;case"css":if(v[r])return void(v[r].href=r+"?v="+ +new Date);document.querySelectorAll("link").forEach(function(n){var e=n.href;e&&(e=e.replace(location.origin,""))===r&&(n.href=e+"?v="+ +new Date,v[r]=n)});break;case"es6":case"js":for(var a in VueRun.staticState){n(VueRun.staticState[a])===r&&VueRun.loadEs(r,a,!0)}document.querySelectorAll("script").forEach(function(n){var e=n.src;if(e)return e=e.replace(location.origin,""),e===r?void location.reload():void 0})}},zwatchWs.onclose=function(n){console.warn("Disconnect from zwatch."),setTimeout(function(){w()},300)}}catch(n){}};if(w(),!window.Vue||!window.Vue.use)return void console.warn("[HMR] Vue not found");u.install=function(n,e){if(!f)return f=!0,a=n.__esModule?n.default:n,s=a.version.split(".").map(Number),d=e,a.config._lifecycleHooks.indexOf("init")>-1&&(p="init"),u.compatible=s[0]>=2,u.compatible?void 0:void console.warn("[HMR] You are using a version of vue-hot-reload-api that is only compatible with Vue.js core ^2.0.0.")},u.install(window.Vue),u.createRecord=function(n,e){if(!l[n]){var t=null;"function"==typeof e&&(t=e,e=t.options),o(n,e),l[n]={Ctor:t,options:e,instances:[]}}},u.isRecorded=function(n){return void 0!==l[n]},u.rerender=r(function(n,e){var o=l[n];if(!e)return void o.instances.slice().forEach(function(n){n.$forceUpdate()});if("function"==typeof e&&(e=e.options),o.Ctor)o.Ctor.options.render=e.render,o.Ctor.options.staticRenderFns=e.staticRenderFns,o.instances.slice().forEach(function(n){n.$options.render=e.render,n.$options.staticRenderFns=e.staticRenderFns,n._staticTrees&&(n._staticTrees=[]),Array.isArray(o.Ctor.options.cached)&&(o.Ctor.options.cached=[]),Array.isArray(n.$options.cached)&&(n.$options.cached=[]);var t=c(n);n.$forceUpdate(),n.$nextTick(t)});else if(o.options.render=e.render,o.options.staticRenderFns=e.staticRenderFns,o.options.functional){if(Object.keys(e).length>2)i(o.options,e);else{var t=o.options._injectStyles;if(t){var r=e.render;o.options.render=function(n,e){return t.call(e),r(n,e)}}}o.options._Ctor=null,Array.isArray(o.options.cached)&&(o.options.cached=[]),o.instances.slice().forEach(function(n){n.$forceUpdate()})}}),u.reload=r(function(n,e){var t=l[n];if(e)if("function"==typeof e&&(e=e.options),o(n,e),t.Ctor){s[1]<2&&(t.Ctor.extendOptions=e);var r=t.Ctor.super.extend(e);r.options._Ctor=t.options._Ctor,t.Ctor.options=r.options,t.Ctor.cid=r.cid,t.Ctor.prototype=r.prototype,r.release&&r.release()}else i(t.options,e);t.instances.slice().forEach(function(n){n.$vnode&&n.$vnode.context?n.$vnode.context.$forceUpdate():console.warn("Root or manually mounted instance modified. Full reload required.")})})},e=setInterval(function(){window.Vue&&window.VueRun&&(clearInterval(e),n())},1e3)}();`
const vueHotReload = `!function(){var n=function(){function n(n){return n?(h.href=n,h.pathname):""}function e(n){var e=n.lastIndexOf(".");return-1!=e?n.substring(e+1,n.length).toLowerCase():""}function o(n,e){if(e.functional){var o=e.render;e.render=function(e,t){var r=l[n].instances;return t&&r.indexOf(t.parent)<0&&r.push(t.parent),o(e,t)}}else t(e,p,function(){var e=l[n];e.Ctor||(e.Ctor=this.constructor),e.instances.push(this)}),t(e,"beforeDestroy",function(){var e=l[n].instances;e.splice(e.indexOf(this),1)})}function t(n,e,o){var t=n[e];n[e]=t?Array.isArray(t)?t.concat(o):[t,o]:[o]}function r(n){return function(e,o){try{n(e,o)}catch(n){console.error(n),console.warn("Something went wrong during Vue component hot-reload. Full reload required.")}}}function i(n,e){for(var o in n)o in e||delete n[o];for(var t in e)n[t]=e[t]}function c(n){if(n._u){var e=n._u;return n._u=function(n){try{return e(n,!0)}catch(o){return e(n,null,!0)}},function(){n._u=e}}}var a,s,u={},l=Object.create(null);window.__VUE_HOT_MAP__=l;var f=!1,d=!1,p="beforeCreate";window.VueRun.debug=u;var v={},h=document.createElement("a"),w=function(){try{var o=location.host;zwatchWs=new WebSocket("ws://"+o+"/"),zwatchWs.onopen=function(n){},zwatchWs.onmessage=function(o){var t=JSON.parse(o.data),r="/"+t.Name,i=e(r);switch(console.log("update:",r),i){case"vue":VueRun.hotReload(r),console.log("hotReload:",r);break;case"html":var c=location.pathname;"/"==c&&(c="/index.html"),r===c&&location.reload();break;case"css":if(v[r])return void(v[r].href=r+"?v="+ +new Date);document.querySelectorAll("link").forEach(function(n){var e=n.href;e&&(e=e.replace(location.origin,""))===r&&(n.href=e+"?v="+ +new Date,v[r]=n)});break;case"es6":case"js":for(var a in VueRun.staticState){n(VueRun.staticState[a])===r&&location.reload()}document.querySelectorAll("script").forEach(function(n){var e=n.src;if(e)return e=e.replace(location.origin,""),e===r?void location.reload():void 0})}},zwatchWs.onclose=function(n){console.warn("Disconnect from zwatch."),setTimeout(function(){w()},300)}}catch(n){}};if(w(),!window.Vue||!window.Vue.use)return void console.warn("[HMR] Vue not found");u.install=function(n,e){if(!f)return f=!0,a=n.__esModule?n.default:n,s=a.version.split(".").map(Number),d=e,a.config._lifecycleHooks.indexOf("init")>-1&&(p="init"),u.compatible=s[0]>=2,u.compatible?void 0:void console.warn("[HMR] You are using a version of vue-hot-reload-api that is only compatible with Vue.js core ^2.0.0.")},u.install(window.Vue),u.createRecord=function(n,e){if(!l[n]){var t=null;"function"==typeof e&&(t=e,e=t.options),o(n,e),l[n]={Ctor:t,options:e,instances:[]}}},u.isRecorded=function(n){return void 0!==l[n]},u.rerender=r(function(n,e){var o=l[n];if(!e)return void o.instances.slice().forEach(function(n){n.$forceUpdate()});if("function"==typeof e&&(e=e.options),o.Ctor)o.Ctor.options.render=e.render,o.Ctor.options.staticRenderFns=e.staticRenderFns,o.instances.slice().forEach(function(n){n.$options.render=e.render,n.$options.staticRenderFns=e.staticRenderFns,n._staticTrees&&(n._staticTrees=[]),Array.isArray(o.Ctor.options.cached)&&(o.Ctor.options.cached=[]),Array.isArray(n.$options.cached)&&(n.$options.cached=[]);var t=c(n);n.$forceUpdate(),n.$nextTick(t)});else if(o.options.render=e.render,o.options.staticRenderFns=e.staticRenderFns,o.options.functional){if(Object.keys(e).length>2)i(o.options,e);else{var t=o.options._injectStyles;if(t){var r=e.render;o.options.render=function(n,e){return t.call(e),r(n,e)}}}o.options._Ctor=null,Array.isArray(o.options.cached)&&(o.options.cached=[]),o.instances.slice().forEach(function(n){n.$forceUpdate()})}}),u.reload=r(function(n,e){var t=l[n];if(e)if("function"==typeof e&&(e=e.options),o(n,e),t.Ctor){s[1]<2&&(t.Ctor.extendOptions=e);var r=t.Ctor.super.extend(e);r.options._Ctor=t.options._Ctor,t.Ctor.options=r.options,t.Ctor.cid=r.cid,t.Ctor.prototype=r.prototype,r.release&&r.release()}else i(t.options,e);t.instances.slice().forEach(function(n){n.$vnode&&n.$vnode.context?n.$vnode.context.$forceUpdate():console.warn("Root or manually mounted instance modified. Full reload required.")})})},e=setInterval(function(){window.Vue&&window.VueRun&&(clearInterval(e),n())},1e3)}();`
2 changes: 1 addition & 1 deletion util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
once sync.Once
installPath string
homePath string
Version = "1.0.20"
Version = "1.0.21"
BuildTime = ""
BuildGoVersion = ""
)
Expand Down

0 comments on commit b0a0d22

Please sign in to comment.