diff options
| author | ruki <[email protected]> | 2019-06-12 22:57:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-06-12 11:43:13 +0800 |
| commit | b7e3a9836f2b4dc7fa034506fbef863ff519de69 (patch) | |
| tree | 4b297ed745e0d302ec1772fa0b509532ee60f06a | |
| parent | 9b8c78dadd744584c64ec892c822333744a04392 (diff) | |
support local package for repo
| -rw-r--r-- | xmake/actions/require/impl/action/download.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua index 15a5d3570..797af48b4 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/action/download.lua @@ -104,8 +104,12 @@ function _download(package, url, sourcedir, url_alias, url_excludes) -- attempt to remove package file first os.tryrm(packagefile) - -- download package file - http.download(url, packagefile) + -- download or copy package file + if os.isfile(url) then + os.cp(url, packagefile) + else + http.download(url, packagefile) + end -- check hash if sourcehash and sourcehash ~= hash.sha256(packagefile) then |
