From 1037dcaeaf332e652bedb11a04cf9665ecaaf425 Mon Sep 17 00:00:00 2001 From: dotcomboom <38927017+dotcomboom@users.noreply.github.com> Date: Mon, 4 May 2020 14:21:00 -0500 Subject: [PATCH] [Quickstart] Fix adding includes to a folder that already exists --- AutoSite/Quickstart.vb | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/AutoSite/Quickstart.vb b/AutoSite/Quickstart.vb index 25ffd556..2a526689 100644 --- a/AutoSite/Quickstart.vb +++ b/AutoSite/Quickstart.vb @@ -50,24 +50,24 @@ MsgBox("AutoSite was not able to create the given subdirectory for some reason." & vbNewLine & vbNewLine & ex.ToString, MsgBoxStyle.Critical, "Unable to copy files") Exit Sub End Try - Dim dir = "" - If My.Computer.FileSystem.DirectoryExists(path) Then - dir = path - ElseIf My.Computer.FileSystem.FileExists(path) Then - dir = My.Computer.FileSystem.GetFileInfo(path).DirectoryName - End If - If My.Computer.FileSystem.DirectoryExists(dir) Then - Main.AddFilesDialog.Title = "Add Files to " & dir - If Main.AddFilesDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then - For Each file In Main.AddFilesDialog.FileNames - Try - My.Computer.FileSystem.CopyFile(file, System.IO.Path.Combine(dir, System.IO.Path.GetFileName(file))) - Catch ex As Exception - MsgBox(ex.Message) - End Try - Next - 'refreshTree(siteTree.Nodes(0)) - End If + End If + Dim dir = "" + If My.Computer.FileSystem.DirectoryExists(path) Then + dir = path + ElseIf My.Computer.FileSystem.FileExists(path) Then + dir = My.Computer.FileSystem.GetFileInfo(path).DirectoryName + End If + If My.Computer.FileSystem.DirectoryExists(dir) Then + Main.AddFilesDialog.Title = "Add Files to " & dir + If Main.AddFilesDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then + For Each file In Main.AddFilesDialog.FileNames + Try + My.Computer.FileSystem.CopyFile(file, System.IO.Path.Combine(dir, System.IO.Path.GetFileName(file))) + Catch ex As Exception + MsgBox(ex.Message) + End Try + Next + 'refreshTree(siteTree.Nodes(0)) End If End If