1
0
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:
Sven Dowideit
2017-06-28 23:58:14 +10:00
parent 204facc395
commit b733bde9cd
7 changed files with 95 additions and 18 deletions

View File

@@ -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 {