[Gambas-user] .gitignore file ¿Dot or not dot?

Martin mbelmonte at belmotek.net
Tue Jan 17 09:47:48 CET 2023


Hi,
I usually use a method to determine if a directory is the one of a 
gambas project [1].
For example I check that there is a .src directory, then that there is a 
.project file and also a .gitignore file and here is the problem. It 
turns out that in gambas3 the file exists but without the dot. Is it a bug?

[1]
'' This function determines if a directory is the base directory of a 
gambas3 project.

Static Public Function DirGambas(sPath As String) As Boolean

   Dim sGambas As Sing

   sGambas = ""

   ' The first three options must be true for the function to return true.
   If Exist(sPath &/ ".project") = True Then
     sGambas = "1"
     If Exist(sPath &/ ".src") = True Then
       sGambas &= "2"
       If Exist(sPath &/ ".hidden") = True Then
         sGambas &= "3"
         If Exist(sPath &/ ".gitignore") = True Then
           sGambas &= "4"
         Endif
       Endif
     Endif
   Endif

   If sGambas = "123" Or sGambas = "1234" Then
     Return True
   Else
     Return False
   Endif

End

Best regards
Martin


More information about the User mailing list