-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(app) require_here follow symlink'd main module #423
Conversation
de3644f
to
544c543
Compare
besides the failing tests, we'd also need an additional test case for this. |
f6611d6
to
5ea97c0
Compare
Apologies for the delay in responding and for the noise in sorting out CI. Please find here a corrected patch, which deals with non-existing script names (and so passes existing tests), and a new test that probes both the default and the CI appears to be failing due to SSL certificate errors in the non-luajit arms, unrelated to this PR. (It also continues to use python2, which is by now well past its best-by date.) |
Ping? |
CI windows is broken, and especially symlinks are an incompatibility between unixes and windows, so need to test that first. Sorry for the delay. |
If a Lua application has, say, a main.lua and a lib.lua side-by-side, and someone symlinks main.lua into (e.g.) ~/bin, we'd like require_here() to look in the original directory, not ~/bin. Symlink-following behavior can be disabled using the (new) second argument to resolve_here.
293b5b5
to
4d27a01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx @nwf finally got CI fixed. Merrging.
### Summary #### 1.13.1 (2022-Jul-22) - fix: `warn` unquoted argument [#439](lunarmodules/Penlight#439) #### 1.13.0 (2022-Jul-22) - fix: `xml.parse` returned nonsense when given a file name [#431](lunarmodules/Penlight#431) - feat: `app.require_here` now follows symlink'd main modules to their directory [#423](lunarmodules/Penlight#423) - fix: `pretty.write` invalid order function for sorting [#430](lunarmodules/Penlight#430) - fix: `compat.warn` raised write guard warning in OpenResty [#414](lunarmodules/Penlight#414) - feat: `utils.enum` now accepts hash tables, to enable better error handling [#413](lunarmodules/Penlight#413) - feat: `utils.kpairs` new iterator over all non-integer keys [#413](lunarmodules/Penlight#413) - fix: `warn` use rawget to not trigger strict-checkers [#437](lunarmodules/Penlight#437) - fix: `lapp` provides the file name when using the default argument [#427](lunarmodules/Penlight#427) - fix: `lapp` positional arguments now allow digits after the first character [#428](lunarmodules/Penlight#428) - fix: `path.isdir` windows root directories (including drive letter) were not considered valid [#436](lunarmodules/Penlight#436)
### Summary #### 1.13.1 (2022-Jul-22) - fix: `warn` unquoted argument [#439](lunarmodules/Penlight#439) #### 1.13.0 (2022-Jul-22) - fix: `xml.parse` returned nonsense when given a file name [#431](lunarmodules/Penlight#431) - feat: `app.require_here` now follows symlink'd main modules to their directory [#423](lunarmodules/Penlight#423) - fix: `pretty.write` invalid order function for sorting [#430](lunarmodules/Penlight#430) - fix: `compat.warn` raised write guard warning in OpenResty [#414](lunarmodules/Penlight#414) - feat: `utils.enum` now accepts hash tables, to enable better error handling [#413](lunarmodules/Penlight#413) - feat: `utils.kpairs` new iterator over all non-integer keys [#413](lunarmodules/Penlight#413) - fix: `warn` use rawget to not trigger strict-checkers [#437](lunarmodules/Penlight#437) - fix: `lapp` provides the file name when using the default argument [#427](lunarmodules/Penlight#427) - fix: `lapp` positional arguments now allow digits after the first character [#428](lunarmodules/Penlight#428) - fix: `path.isdir` windows root directories (including drive letter) were not considered valid [#436](lunarmodules/Penlight#436)
### Summary #### 1.13.1 (2022-Jul-22) - fix: `warn` unquoted argument [#439](lunarmodules/Penlight#439) #### 1.13.0 (2022-Jul-22) - fix: `xml.parse` returned nonsense when given a file name [#431](lunarmodules/Penlight#431) - feat: `app.require_here` now follows symlink'd main modules to their directory [#423](lunarmodules/Penlight#423) - fix: `pretty.write` invalid order function for sorting [#430](lunarmodules/Penlight#430) - fix: `compat.warn` raised write guard warning in OpenResty [#414](lunarmodules/Penlight#414) - feat: `utils.enum` now accepts hash tables, to enable better error handling [#413](lunarmodules/Penlight#413) - feat: `utils.kpairs` new iterator over all non-integer keys [#413](lunarmodules/Penlight#413) - fix: `warn` use rawget to not trigger strict-checkers [#437](lunarmodules/Penlight#437) - fix: `lapp` provides the file name when using the default argument [#427](lunarmodules/Penlight#427) - fix: `lapp` positional arguments now allow digits after the first character [#428](lunarmodules/Penlight#428) - fix: `path.isdir` windows root directories (including drive letter) were not considered valid [#436](lunarmodules/Penlight#436)
If a Lua application has, say, a main.lua and a lib.lua side-by-side,
and someone symlinks main.lua into (e.g.) ~/bin, we'd like
require_here() to look in the original directory, not ~/bin.
Symlink-following behavior can be disabled using the (new) second
argument to resolve_here.