Fixe target path location check in jekyll import command
authorJelmer Tiete <jelmer@tiete.be>
Sun, 11 Sep 2016 08:48:31 +0000 (01:48 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 11 Sep 2016 08:48:31 +0000 (10:48 +0200)
commands/import_jekyll.go

index 20356f1e1662df0d19d5433cd62127ed8551602d..7c595d8a17deebad4ab20aadebf9581bacbe1426 100644 (file)
@@ -81,7 +81,7 @@ func importFromJekyll(cmd *cobra.Command, args []string) error {
 
        jww.INFO.Println("Import Jekyll from:", jekyllRoot, "to:", targetDir)
 
-       if strings.HasPrefix(targetDir, jekyllRoot) {
+       if strings.HasPrefix(filepath.Dir(targetDir), jekyllRoot) {
                return newUserError("Target path should not be inside the Jekyll root, aborting.")
        }