pub fn swap_binary(binary_path: &Path, new_data: &[u8]) -> Result<()>Expand description
Swap the old binary with the new one.
- Rename the current binary to a
.oldtemporary file - Write the new binary to the original path
- Set executable permissions
- Remove the
.oldtemporary file