[DEVELOPMENT ENVIRONMENT]
* NEW: Automatically create a ".gitignore" file in the project directory. git-svn-id: svn://localhost/gambas/trunk@6272 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
c363af4b17
commit
d8d8754716
2 changed files with 51 additions and 1 deletions
|
@ -623,7 +623,11 @@ _INIT_AGAIN:
|
|||
ReadProject
|
||||
|
||||
If Not ReadOnly Then
|
||||
If Not Exist(Project.Dir &/ ".hidden") Then Project.InsertDirectory(Project.Dir &/ ".hidden")
|
||||
|
||||
If Not Exist(Project.Dir &/ ".hidden") Then InsertDirectory(Project.Dir &/ ".hidden")
|
||||
|
||||
CreateGitIgnore
|
||||
|
||||
Endif
|
||||
Dec $iNoRefresh
|
||||
|
||||
|
@ -4983,6 +4987,39 @@ Catch
|
|||
|
||||
End
|
||||
|
||||
Private Sub CreateGitIgnore()
|
||||
|
||||
Dim sPath As String = Project.Dir &/ ".gitignore"
|
||||
Dim sData As String
|
||||
Dim iPos As Integer
|
||||
Dim iPos2 As Integer
|
||||
|
||||
If Not Exist(sPath) Then
|
||||
Try Copy "gitignore" To sPath
|
||||
Return
|
||||
Endif
|
||||
|
||||
sData = File.Load(sPath)
|
||||
iPos = InStr(sData, "#---- Gambas files to ignore (v1)")
|
||||
If iPos Then Return
|
||||
|
||||
iPos = InStr(sData, "#---- Gambas files to ignore")
|
||||
If iPos Then
|
||||
iPos2 = InStr(sData, "#----", iPos + 5)
|
||||
If iPos2 Then
|
||||
iPos2 = InStr(sData, "\n", iPos2)
|
||||
If iPos2 = 0 Then iPos2 = Len(sData) + 1
|
||||
sData = Left(sData, iPos - 1) & Mid$(sData, iPos2)
|
||||
Endif
|
||||
Endif
|
||||
|
||||
sData = RTrim(sData)
|
||||
If sData Then sData &= "\n"
|
||||
|
||||
File.Save(sPath, sData & File.Load("gitignore"))
|
||||
|
||||
End
|
||||
|
||||
Public Sub CleanUp(Optional sDir As String = Project.Dir)
|
||||
|
||||
Dim sFile As String
|
||||
|
|
13
app/src/gambas3/gitignore
Normal file
13
app/src/gambas3/gitignore
Normal file
|
@ -0,0 +1,13 @@
|
|||
#---- Gambas files to ignore (v1)
|
||||
*.gambas
|
||||
.lock
|
||||
*~
|
||||
core
|
||||
core.*
|
||||
vgcore
|
||||
vgcore.*
|
||||
.kdbg*
|
||||
.*.prof
|
||||
.lang/*.pot
|
||||
.gambas/*
|
||||
#----
|
Loading…
Reference in a new issue