xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

Support explict git source for xmake update #437

Closed OpportunityLiu closed 5 years ago

OpportunityLiu commented 5 years ago

Support xmake update gitrepo#branch to install form given repo and branch.

eg. xmake update https://github.com/xmake-io/xmake#dev

Supported format:

-- original
<branch>
<semver>
-- added
<git-source>[#<branch>]
github:<owner>/<repo>[#<branch>]
gitlab:<owner>/<repo>[#<branch>]
gitee:<owner>/<repo>[#<branch>]
bitbucket:<owner>/<repo>[#<branch>]

See: https://github.com/xmake-io/xmake/blob/7021c6e06c49f78ee948c69c51322fa64071a1b0/xmake/modules/devel/git/asgiturl.lua#L24-L30

OpportunityLiu commented 5 years ago

不过就目前win上的机制是没法实现的。。。

waruqi commented 5 years ago

嗯,现在主要是win上处理起来 有点问题,需要花时间去支持

waruqi commented 5 years ago

https://github.com/xmake-io/xmake/issues/264

OpportunityLiu commented 5 years ago

需要支持到哪个版本,感觉xp要搞就很麻烦,win7还行,反正可以装PowerShell5

waruqi commented 5 years ago

xp也要支持的。我现在主要就是在xp下跑 偶尔测测win10/win7, xp下我感觉处理起来还简单些,要在cmd下也能支持运行xmake update dev,不依赖ps

OpportunityLiu commented 5 years ago

那就只能vbs了

waruqi commented 5 years ago

对于uac的命令运行,里面有个脚本就是vbs处理的,可以参考下:

https://github.com/xmake-io/xmake/blob/3633407fdd3f55288c602238957f9e9fa16fc063/xmake/actions/update/main.lua#L94-L98

OpportunityLiu commented 5 years ago

这脚本有啥坑吗?为啥sudo.has()还是要返回false而不是直接用这个实现?

waruqi commented 5 years ago

sudo.lua 那个模块,当初支持了 linux/macos ,对于win 还没有封装进去,虽然后来加了个 sudo.vbs,但还是半成品,封装仅sudo.lua ,也许还需要做很多细节处理。

比如环境变量的传递等,当前执行权限的检测等,想要完美模拟 linux 下的sudo 还有点距离。所以我就先不封装进去,暂时单独拎出来直接执行的sudo.vbs