install: consolidate dawio usage, remove direct io/os calls #8

Open
opened 2026-05-26 05:03:44 +02:00 by michael · 0 comments
Owner

Findings

1. Direct os.execute calls

os.execute("rm -rf " .. dir) and os.execute("rm -rf " .. temp_dir)
violate the DAW architecture rule -- all shell execution must go through
out:run_rc().

2. Direct io.* and print() calls

print_entry() uses print() directly.
prompt_install() uses io.write(), io.flush(), io.read() directly.
Both functions receive no out parameter and are not testable.
Must use dawio / sys.new() consistently.

3. Repeated lazy require of daw.common.sys

require("daw.common.sys") is called multiple times inside function
bodies throughout the file. Should be a single top-level require.

4. Lazy require of daw.common.config_parser

require("daw.common.config_parser") inside read_require_path().
Should be top-level.

5. _NAME declared after requires

Minor consistency issue -- all other files declare _NAME before
the require block.

Acceptance Criteria

  • os.execute replaced with out:run_rc()
  • print_entry() and prompt_install() accept out parameter
  • All require("daw.common.sys") consolidated at top level
  • require("daw.common.config_parser") moved to top level
  • _NAME moved before requires
  • Tests pass after changes
## Findings ### 1. Direct os.execute calls `os.execute("rm -rf " .. dir)` and `os.execute("rm -rf " .. temp_dir)` violate the DAW architecture rule -- all shell execution must go through `out:run_rc()`. ### 2. Direct io.* and print() calls `print_entry()` uses `print()` directly. `prompt_install()` uses `io.write()`, `io.flush()`, `io.read()` directly. Both functions receive no `out` parameter and are not testable. Must use `dawio` / `sys.new()` consistently. ### 3. Repeated lazy require of daw.common.sys `require("daw.common.sys")` is called multiple times inside function bodies throughout the file. Should be a single top-level require. ### 4. Lazy require of daw.common.config_parser `require("daw.common.config_parser")` inside `read_require_path()`. Should be top-level. ### 5. _NAME declared after requires Minor consistency issue -- all other files declare `_NAME` before the require block. ## Acceptance Criteria - [ ] `os.execute` replaced with `out:run_rc()` - [ ] `print_entry()` and `prompt_install()` accept `out` parameter - [ ] All `require("daw.common.sys")` consolidated at top level - [ ] `require("daw.common.config_parser")` moved to top level - [ ] `_NAME` moved before requires - [ ] Tests pass after changes
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-module-manager#8
No description provided.