diff options
| author | ruki <[email protected]> | 2022-03-13 16:49:46 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-03-13 16:49:46 +0800 |
| commit | fd3212860f087849cd59c0435f66da2aac52f32a (patch) | |
| tree | 902699a1d4d4a1ef7eb71f5d4c0e9e8da1fef9f5 /xmake/modules/private/action/require/impl/repository.lua | |
| parent | 321b13a3b93168eb840d3cb395300b5e43288307 (diff) | |
improve to pull repo
Diffstat (limited to 'xmake/modules/private/action/require/impl/repository.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/repository.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/xmake/modules/private/action/require/impl/repository.lua b/xmake/modules/private/action/require/impl/repository.lua index 6fb4fccdc..f6ad1b777 100644 --- a/xmake/modules/private/action/require/impl/repository.lua +++ b/xmake/modules/private/action/require/impl/repository.lua @@ -115,16 +115,18 @@ end function pulled() if global.get("network") ~= "private" then for _, repo in ipairs(repositories()) do - -- repository not found? or xmake has been re-installed - local repodir = repo:directory() - local updatefile = path.join(repodir, "updated") - if not os.isfile(updatefile) or (os.isfile(updatefile) and os.mtime(os.programfile()) > os.mtime(updatefile)) then - -- fix broken empty directory - -- @see https://github.com/xmake-io/xmake/issues/2159 - if os.isdir(repodir) and os.emptydir(repodir) then - os.tryrm(repodir) + if not os.isdir(repo:url()) then + -- repository not found? or xmake has been re-installed + local repodir = repo:directory() + local updatefile = path.join(repodir, "updated") + if not os.isfile(updatefile) or (os.isfile(updatefile) and os.mtime(os.programfile()) > os.mtime(updatefile)) then + -- fix broken empty directory + -- @see https://github.com/xmake-io/xmake/issues/2159 + if os.isdir(repodir) and os.emptydir(repodir) then + os.tryrm(repodir) + end + return false end - return false end end end |
