Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support explict git source for xmake update #437

Closed
OpportunityLiu opened this issue Jun 3, 2019 · 9 comments

Comments

@OpportunityLiu
Copy link
Contributor

commented Jun 3, 2019

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:

local custom_protocol =
{
["github:"] = "https://github.com"
, ["gitlab:"] = "https://gitlab.com"
, ["gitee:"] = "https://gitee.com"
, ["bitbucket:"] = "https://bitbucket.org"
}

@OpportunityLiu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

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

@waruqi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

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

@waruqi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

@OpportunityLiu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

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

@waruqi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

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

@OpportunityLiu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

那就只能vbs了

@waruqi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

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

if winos:version():gt("winxp") then
local proc = process.openv("cscript", {path.join(os.programdir(), "scripts", "sudo.vbs"), uninstaller})
if proc ~= nil then
process.close(proc)
end

@OpportunityLiu

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

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

@waruqi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.