@@ -19,8 +19,9 @@ Option Explicit
1919' verwendete Erweiterungen
2020Private Const EXTENSION_KEY_APPFILE As String = "AppFile"
2121Private Const APPFILE_PROPNAME_APPICON As String = "AppIcon"
22- Private Const RepositorySource_GitHub As Long = 1
23- Private Const RepositorySource_LocalRepository As Long = 2
22+ Private Const RepositorySource_LocalRepository As Long = 1
23+ Private Const RepositorySource_GitHub As Long = 2
24+ Private Const RepositorySource_Package As Long = 4
2425
2526Private Const TEMPDB_TABNAME As String = "tRepositoryFiles"
2627Private Const TEMPDB_TABDDL As String = "create table " & TEMPDB_TABNAME & " (LocalRepositoryPath varchar(255) primary key, ObjectName varchar(255), Description memo)"
@@ -171,7 +172,7 @@ On Error GoTo HandleErr
171172 Me.Repaint
172173
173174 Set ACLibFileMngr = CurrentACLibFileManager
174- If Me.ogRepositorySource = RepositorySource_GitHub Then
175+ If ( Me.ogRepositorySource And RepositorySource_GitHub) = RepositorySource_GitHub Then
175176 Set m_ACLibFileManager = ACLibFileMngr
176177 Else '
177178 Set m_ACLibFileManager = Nothing
@@ -409,7 +410,9 @@ On Error GoTo HandleErr
409410 Loop
410411 End If
411412
412- StartFolder = CurrentLocalRepositoryPath & StartFolder
413+ If Mid(StartFolder, 2 , 1 ) <> ":" Then
414+ StartFolder = CurrentLocalRepositoryPath & StartFolder
415+ End If
413416 Do While Not DirExists(StartFolder)
414417 Pos = InStrRev(StartFolder, "\" )
415418 If Pos = 0 Then Exit Do
@@ -670,13 +673,30 @@ Private Sub ConfigReproSourceMode(Optional NewMode As Long = 0)
670673End Sub
671674
672675Private Sub SetACLibGitHubImporterConfig ()
673- If Me.ogRepositorySource = RepositorySource_GitHub Then
674- If Len(Me.txtGitHubAuthPersonalAccessToken.Value) > 0 Then
675- ACLibGitHubImporter.GitHubApiAuthorizationToken = Me.txtGitHubAuthPersonalAccessToken.Value
676- End If
676+ If (Me.ogRepositorySource.Value And RepositorySource_GitHub) = RepositorySource_GitHub Then
677+ If Len(Me.txtGitHubAuthPersonalAccessToken.Value) > 0 Then
678+ ACLibGitHubImporter.GitHubApiAuthorizationToken = Me.txtGitHubAuthPersonalAccessToken.Value
679+ End If
680+ If (Me.ogRepositorySource.Value And RepositorySource_Package) = RepositorySource_Package Then
681+ SetRepositoryData "AccessCodeLib" , "ACLibImportWizard-Package" , "main"
682+ ElseIf Me.txtRepoName.Value = "ACLibImportWizard-Package" Then
683+ SetRepositoryData "AccessCodeLib" , "AccessCodeLib" , "master"
684+ End If
677685 End If
678686End Sub
679687
688+ Private Sub SetRepositoryData (ByVal RepositoryOwner As String , ByVal RepositoryName As String , ByVal BranchName As String )
689+
690+ Me.txtRepoOwner.Value = RepositoryOwner
691+ Me.txtRepoName.Value = RepositoryName
692+ Me.txtRepoBranch.Value = BranchName
693+
694+ ACLibGitHubImporter.RepositoryOwner = RepositoryOwner
695+ ACLibGitHubImporter.RepositoryName = RepositoryName
696+ ACLibGitHubImporter.BranchName = BranchName
697+
698+ End Sub
699+
680700Private Sub Form_Unload (ByRef Cancel As Integer )
681701On Error Resume Next
682702 If Not (m_TempDb Is Nothing ) Then
@@ -846,7 +866,7 @@ Private Sub AddFileFromFileName(ByVal ACLibFileString As String)
846866
847867On Error GoTo HandleErr
848868
849- If Me.ogRepositorySource = RepositorySource_GitHub Then
869+ If ( Me.ogRepositorySource.Value And RepositorySource_GitHub) = RepositorySource_GitHub Then
850870
851871 FileArray(0 ) = ACLibFileString
852872 DownLoadFiles FileArray
@@ -1139,7 +1159,7 @@ Private Sub OpenRepositoryFileInTextViewer(ByVal ACLibPath As String)
11391159
11401160 Dim FullPath As String
11411161
1142- If Me.ogRepositorySource = RepositorySource_GitHub Then
1162+ If ( Me.ogRepositorySource.Value And RepositorySource_GitHub) = RepositorySource_GitHub Then
11431163 FullPath = DownLoadFile(ACLibPath)
11441164 Else
11451165 FullPath = CurrentACLibFileManager.GetRepositoryFullPath(ACLibPath)
0 commit comments