mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
add some better menu touches, make upgrade also upgrade to the menu, and add a ros config syslinux cmd for editing the global.cfg
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
@@ -264,15 +264,21 @@ func defaultFolders(folders ...string) error {
|
||||
}
|
||||
|
||||
func CopyFile(src, folder, name string) error {
|
||||
return CopyFileOverwrite(src, folder, name, false)
|
||||
}
|
||||
|
||||
func CopyFileOverwrite(src, folder, name string, overwrite bool) error {
|
||||
if _, err := os.Lstat(src); os.IsNotExist(err) {
|
||||
log.Debugf("Not copying %s, does not exists", src)
|
||||
return nil
|
||||
}
|
||||
|
||||
dst := path.Join(folder, name)
|
||||
if _, err := os.Lstat(dst); err == nil {
|
||||
log.Debugf("Not copying %s => %s already exists", src, dst)
|
||||
return nil
|
||||
if !overwrite {
|
||||
if _, err := os.Lstat(dst); err == nil {
|
||||
log.Debugf("Not copying %s => %s already exists", src, dst)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if err := createDirs(folder); err != nil {
|
||||
|
Reference in New Issue
Block a user