1 Star 0 Fork 20

Greyooo/gtfpch

forked from kerrydu/gtfpch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gtfpchcheckupdate.ado 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
kerrydu 提交于 2021-10-22 17:41 . revised for sj
cap program drop gtfpchcheckupdate
program define gtfpchcheckupdate
version 16
global gtfpchcheck done
local url1 https://raw.githubusercontent.com/kerrydu/gtfpch/master/
local url2 https://gitee.com/kerrydu/gtfpch/raw/master/
cap mata: vfile = cat(`"`url1'/`0'.ado"')
if _rc{
cap mata: vfile = cat(`"`url2'/`0'.ado"')
}
if _rc exit
mata: vfile = select(vfile,vfile:!="")
mata: vfile = usubinstr(vfile,char(9)," ",.)
mata: vfile = select(vfile,!ustrregexm(vfile,"^( )+$"))
mata: st_local("versiongit",vfile[1])
local versiongit = ustrregexrf("`versiongit'","^[\D]+","")
gettoken vers versiongit:versiongit, p(", ")
local versiongit `vers'
qui findfile `0'.ado
mata: vfile = cat("`r(fn)'")
mata: vfile = select(vfile,vfile:!="")
mata: vfile = usubinstr(vfile,char(9)," ",.)
mata: vfile = select(vfile,!ustrregexm(vfile,"^( )+$"))
mata: st_local("versionuse",vfile[1])
local versionuse = ustrregexrf("`versionuse'","^[\D]+","")
gettoken vers versionuse:versionuse, p(", ")
local versionuse `vers'
if(`versionuse'<`versiongit'){
di "New version available, `versionuse' =>`versiongit'"
di "It can be updated by:"
di " net install gtfpch,from(https://raw.githubusercontent.com/kerrydu/gtfpch/master/) replace"
di "or,"
di " net install gtfpch,from(https://gitee.com/kerrydu/gtfpch/raw/master/) replace"
}
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/greyooo/gtfpch.git
git@gitee.com:greyooo/gtfpch.git
greyooo
gtfpch
gtfpch
master

搜索帮助