feat(fs): add abspath to resolve relative paths #31
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-common#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Add
fs.abspath(path)todaw.common.fsto resolve relative pathsto absolute paths without requiring callers to depend on
lfsdirectly.Background
DAW/fragjan#102 requires walking upward from a directory to find
.fragjan.The upward walk in
core/detect.find_project_rootneeds an absolute pathas starting point. Currently there is no
fs.abspath-- callers would haveto use
lfs.currentdir()directly, leaking an lfs dependency into modulesthat should not need it.
Requirements
fs.abspath(path)resolves a relative path againstlfs.currentdir()Acceptance Criteria
fs.abspath(path)implemented indaw/common/fs.lualfs.currentdir()test/test_fs.luaRelated
Implementation
fs.abspath(path)added tofs.luain the Query block afterread_attrsrealpaththroughdaw.common.sys:run()-- no directio.*daw.common.sysloaded at module level viapcall(consistent withlfspattern)/) pass through unchangednil, errif path does not exist (realpath exits non-zero)test/test_fs.luadaw.common.sysmapping added totest/dev-module-map.luaNotes
realpathavailable on all target platforms (OpenBSD 7.1+, Debian, Arch)