michalfita/packer-plugin-cross

Eliminate simple systems commands

michalfita opened this issue · 0 comments

Problem

In multiple places the plugin unnecessary calls commands for file operations, what's bad practice and non-portable solution. Example:

out, err = exec.Command("cp", "-rf", archivePath, dst).CombinedOutput()

Proposal

Replace use of external invocation of standard Unix commands with standard library equivalents of file operations or (when they're missing from API¹) with Go packages.


¹ lack of file copying makes me coming from Rust 🤣