saving changes

pull/3/head
Marcusk19 2 years ago committed by Marcus Kok
parent 77ef043a73
commit a992bcde84

@ -7,18 +7,25 @@ import (
"path/filepath" "path/filepath"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/Marcusk19/bender/tools"
) )
func init() { func init() {
RootCmd.AddCommand(initCommand) RootCmd.AddCommand(initCommand)
} }
func backupExistingConfigs(programs []string) { func copyExistingConfigs(programs []string, destRootOpt ...string) {
// takes list of programs and backs up configs for them // takes list of programs and backs up configs for them
destRoot := os.Getenv("HOME") + "/.dotfiles/"
if len(destRootOpt) > 0 {
destRoot = destRootOpt[0]
}
configRoot := os.Getenv("HOME") + "/.config/" configRoot := os.Getenv("HOME") + "/.config/"
for _, program := range(programs) { for _, program := range(programs) {
// TODO: do something here // TODO: do something here
print(configRoot + program) print(configRoot + program)
tools.CopyDir(filepath.Join(configRoot, program), filepath.Join(destRoot, program))
} }
} }

Loading…
Cancel
Save