mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 18:00:33 +08:00
[IJ] Setup working dir in RunTerminal.kt
; Fit .gitignore
rules; fix #366
This commit is contained in:
parent
3d83fde396
commit
f10dca99a6
@ -122,5 +122,16 @@ run/
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
### Mirai Console Files ###
|
||||
|
||||
# Local Test Launch point
|
||||
src/test/kotlin/RunTerminal.kt
|
||||
|
||||
# Mirai console files with direct bootstrap
|
||||
/config
|
||||
/data
|
||||
/plugins
|
||||
/bots
|
||||
|
||||
# Local Test Launch Point working directory
|
||||
/debug-sandbox
|
||||
|
@ -1,12 +1,20 @@
|
||||
package $PACKAGE_NAME
|
||||
|
||||
import java.io.File
|
||||
import net.mamoe.mirai.alsoLogin
|
||||
import net.mamoe.mirai.console.MiraiConsole
|
||||
import net.mamoe.mirai.console.plugin.PluginManager.INSTANCE.enable
|
||||
import net.mamoe.mirai.console.plugin.PluginManager.INSTANCE.load
|
||||
import net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader
|
||||
|
||||
fun setupWorkingDir() {
|
||||
// see: net.mamoe.mirai.console.terminal.MiraiConsoleImplementationTerminal
|
||||
System.setProperty("user.dir", File("debug-sandbox").absolutePath)
|
||||
}
|
||||
|
||||
suspend fun main() {
|
||||
setupWorkingDir()
|
||||
|
||||
MiraiConsoleTerminalLoader.startAsDaemon()
|
||||
|
||||
val pluginInstance = ${CLASS_NAME}#if (${LANGUAGE_TYPE} != "Kotlin").INSTANCE #end
|
||||
|
Loading…
Reference in New Issue
Block a user