From afabdd2cebd92c4ae27b2ca174f6089206645b9e Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sat, 5 Dec 2020 17:18:22 -0800 Subject: [PATCH] Use os.MkdirAll() instead of os.Mkdir() for cases where ~/Downloads is nonexistant --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 1eabbd3..31bfeeb 100644 --- a/config.go +++ b/config.go @@ -148,7 +148,7 @@ func (config *Config) ExecuteAction(srcDir string) { // Set destination directory to ~/Downloads/{dir name} dstDir := homeDir + "/Downloads/" + config.ActionData // Try to create destination directory - err := os.Mkdir(dstDir, 0755) + err := os.MkdirAll(dstDir, 0755) if err != nil { log.Fatal().Err(err).Msg("Error creating directory") } // Try to open tar archive file tarFile, err := os.Open(srcDir + "/" + config.ActionData + ".tar")