Skip to content

Commit

Permalink
fix redirects and windows upload path
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish committed Oct 14, 2023
1 parent 507703d commit 9fad407
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
if: ${{ matrix.build_type == 'Release' }}
with:
name: japp-windows-${{ matrix.arch }}-${{ matrix.build_type }}
path: ${{ github.workspace }}
path: ${{ github.workspace }}/japp-windows-${{ matrix.arch }}-${{ matrix.build_type }}.zip
if-no-files-found: error

ubuntu:
Expand Down
17 changes: 6 additions & 11 deletions package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require 'lfs' -- lua filesystem
requirements:
- lua 5.4
- luafilesystem
- 7zip or zip
- 7z or zip
--]]

if lfs == nil then error('missing lua-filesystem (Lua ' .. _VERSION .. ') - try installing with luarocks') end
Expand Down Expand Up @@ -45,15 +45,10 @@ local libExt = ({
Darwin = '.dylib',
})[host_platform]
local extension = nixy and '.zip' or '.pk3'
local redirect_cmd = nixy and '>/dev/null' or '>nul'
local redirect_stdout = nixy and '>/dev/null' or '>nul'
local redirect_all = nixy and '>/dev/null 2>&1' or '>nul 2>&1'

local function test_cmd(cmd)
if nixy then
return os.execute('command -v ' .. cmd .. redirect_cmd)
else
return os.execute('where.exe ' .. cmd .. redirect_cmd)
end
end
local function test_cmd(cmd) return os.execute((nixy and 'command -v ' or 'where.exe ') .. cmd .. redirect_all) end

local paks = {
['cl'] = {
Expand Down Expand Up @@ -91,9 +86,9 @@ for prefix, pak in pairs(paks) do
print('creating "' .. outname .. '"')
local cmd = nil
if test_cmd('zip') then
cmd = 'zip ' .. outname .. ' ' .. filelist .. redirect_cmd
cmd = 'zip ' .. outname .. ' ' .. filelist .. redirect_stdout
elseif test_cmd('7z') then
cmd = '7z a -tzip -y ' .. outname .. ' ' .. filelist .. ' ' .. redirect_cmd
cmd = '7z a -tzip -y ' .. outname .. ' ' .. filelist .. ' ' .. redirect_stdout
else
error('can\'t find zip or 7z on PATH')
end
Expand Down

0 comments on commit 9fad407

Please sign in to comment.