File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 66
77 <groupId >PAL-Launcher</groupId >
88 <artifactId >rewrite</artifactId >
9- <version >1.0-SNAPSHOT </version >
9+ <version >2.0.1 </version >
1010
1111 <properties >
1212 <kotlin .version>1.3.0</kotlin .version>
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import javafx.scene.control.CheckBox
2424import javafx.scene.layout.AnchorPane
2525import org.kohsuke.github.GHAsset
2626import org.kohsuke.github.GHRelease
27+ import org.kohsuke.github.GitHub
2728import java.net.URI
2829import java.nio.file.Files
2930import java.nio.file.Paths
@@ -214,7 +215,18 @@ class LaunchController: Initializable
214215 }
215216
216217 GlobalScope .launch {
217- val gh = connect()
218+ lateinit var gh: GitHub
219+
220+ gh = if (pcGithubToken.text != " " )
221+ {
222+ connect(pcGithubToken.text)
223+ }
224+ else
225+ {
226+ connect()
227+ }
228+
229+
218230 if (canQuerry(gh))
219231 {
220232 lpStatusAdd(" \n\n Connect Succesful\n You have ${gh.rateLimit.remaining} requests left which reset at:\n ${gh.rateLimit.resetDate} " )
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ fun connect(): GitHub
2929 return GitHub .connectAnonymously()
3030}
3131
32+ fun connect (arg : String ): GitHub
33+ {
34+ return GitHub .connectUsingOAuth(arg)
35+ }
36+
3237fun checkReleases (github : GitHub ): MutableList <GHRelease >?
3338{
3439 val repo = github.getRepository(Constants .REPOSITORY )
You can’t perform that action at this time.
0 commit comments