A cross-platform Go CLI tool to move a binary to a system-wide path (e.g., /usr/local/bin
on Unix). Handles macOS, Linux, and Windows.
- Auto-detects OS and target directory.
- Sets executable permissions on Unix.
- Validates file existence and prevents overwrites.
- Creates destination dir if needed.
- Ensure Go 1.21+ is installed.
- Save
movebin.go
. - Build:
go build movebin.go
. - Self-install:
sudo ./movebin ./movebin
. - Run:
movebin /path/to/binary
.
movebin ./myapp
- macOS/Linux: Moves to
/usr/local/bin/myapp
(usesudo
for perms). - Windows: Moves to
C:\Program Files\bin\myapp.exe
(run as Admin).
Output: Successfully moved /path/to/myapp to /usr/local/bin/myapp
.
MIT.