Skip to content

Commit

Permalink
better gh login
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Nov 28, 2023
1 parent 9dedd54 commit a544a15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 11 additions & 8 deletions Project/Sources/Classes/gh.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,22 @@ Function getStatus() : Object
This:C1470.errors.push("Failed to get the user status.")

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function logIn()
Function logIn() : Boolean

var $worker : 4D:C1709.SystemWorker

If (Not:C34(This:C1470.authorized))
If (This:C1470.authorized)

$worker:=4D:C1709.SystemWorker.new(This:C1470.exe+" auth login -h github.com -p HTTPS -s repo"; This:C1470).wait()
return True:C214

End if

$worker:=4D:C1709.SystemWorker.new(This:C1470.exe+" auth login -h github.com -p HTTPS -s repo"; This:C1470).wait()

If (This:C1470.success)

return This:C1470.checkToken()

If (This:C1470.success)

This:C1470.checkToken()

End if
End if

// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Expand Down
6 changes: 5 additions & 1 deletion Project/Sources/Forms/GIT/ObjectMethods/embeddedDialogs.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ If ($e.code<0)

End if

$gh.logIn()
If (Not:C34($gh.logIn()))

return

End if

// Create remote
var $remote : Text
Expand Down

0 comments on commit a544a15

Please sign in to comment.