Skip to content

Commit

Permalink
Remove number_ret check in aegisub/lfs.moon lua
Browse files Browse the repository at this point in the history
Calling tonumber() on bool values always returns nil, which is not what we need
This also reverts commit d5d2322.
  • Loading branch information
wangqr committed Jun 6, 2021
1 parent a547e67 commit 7fd42c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/gha-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ jobs:
fi
fi
# FIXME: penlight has 1.10
sudo luarocks install penlight 1.9.2 > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ penlight 1.9.2 > /dev/null
sudo luarocks install busted > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ busted > /dev/null
sudo luarocks install moonscript > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ moonscript > /dev/null
sudo luarocks install uuid > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ uuid > /dev/null
Expand Down
3 changes: 0 additions & 3 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
popd
fi
fi

# FIXME: penlight has 1.10
sudo luarocks install penlight 1.9.2 > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ penlight 1.9.2 > /dev/null
sudo luarocks install busted > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ busted > /dev/null
sudo luarocks install moonscript > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ moonscript > /dev/null
sudo luarocks install uuid > /dev/null || sudo luarocks install --server https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ uuid > /dev/null
12 changes: 4 additions & 8 deletions automation/include/aegisub/lfs.moon
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ string_ret = (f) -> (...) ->
res, err = f ...
ffi_util.string(res), err

number_ret = (f) -> (...) ->
res, err = f ...
tonumber(res), err

attributes = check'string ?string' (path, field) ->
switch field
when 'mode'
Expand Down Expand Up @@ -73,10 +69,10 @@ dir = check'string' (path) ->

return {
:attributes
chdir: check'string' number_ret impl.chdir
chdir: check'string' impl.chdir
currentdir: check'' string_ret impl.currentdir
:dir
mkdir: check'string' number_ret impl.mkdir
rmdir: check'string'number_ret impl.rmdir
touch: check'string'number_ret impl.touch
mkdir: check'string' impl.mkdir
rmdir: check'string' impl.rmdir
touch: check'string' impl.touch
}

0 comments on commit 7fd42c8

Please sign in to comment.