Initial commit
This commit is contained in:
commit
5ed259c54c
4 changed files with 252 additions and 0 deletions
27
cmd/relocate.go
Normal file
27
cmd/relocate.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/rdesaintleger/relocate-distro/pkg/relocator"
|
||||
)
|
||||
|
||||
func Execute() {
|
||||
prefix := flag.String("prefix", "", "Target prefix directory")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *prefix == "" {
|
||||
fmt.Println("Error: target prefix directory is required")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
for _, src := range flag.Args() {
|
||||
err := relocator.RelocateFile(*prefix, src)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error processing %s: %v\n", src, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue