diff options
| author | ruki <[email protected]> | 2023-11-21 22:41:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-21 22:41:26 +0800 |
| commit | b07ccfbad1bf0ab942bf9247f09655c75f5cf199 (patch) | |
| tree | 6e4a2afdc2afec5ad101f5246daf7836133fe0ef /xmake/plugins/pack/xpack.lua | |
| parent | d9bd4228a079cadf73092c1317a3a34717c6f3e6 (diff) | |
pack xmakesrc tar.gz and zip
Diffstat (limited to 'xmake/plugins/pack/xpack.lua')
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua index 0d6dd08f3..07e162c67 100644 --- a/xmake/plugins/pack/xpack.lua +++ b/xmake/plugins/pack/xpack.lua @@ -320,15 +320,23 @@ function xpack:specfile() return self:get("specfile") or path.join(self:buildir(), self:basename() .. extension) end +-- get the extension +function xpack:extension() + local extension = self:get("extension") + if extension == nil then + local extensions = { + nsis = ".exe", + zip = ".zip", + targz = ".tar.gz" + } + extension = extensions[self:format()] or "" + end + return extension +end + -- get the output filename function xpack:filename() - local extensions = { - nsis = ".exe", - zip = ".zip", - targz = ".tar.gz" - } - local extension = extensions[self:format()] or "" - return self:basename() .. extension + return self:basename() .. self:extension() end -- get the output file |
