mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			676 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			676 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
 | 
						|
 | 
						|
package teaconst
 | 
						|
 | 
						|
import (
 | 
						|
	"os"
 | 
						|
	"strings"
 | 
						|
)
 | 
						|
 | 
						|
var (
 | 
						|
	IsRecoverMode = false
 | 
						|
 | 
						|
	IsDemoMode         = false
 | 
						|
	ErrorDemoOperation = "DEMO模式下无法进行创建、修改、删除等操作"
 | 
						|
 | 
						|
	NewVersionCode        = "" // 有新的版本
 | 
						|
	NewVersionDownloadURL = "" // 新版本下载地址
 | 
						|
 | 
						|
	IsMain = checkMain()
 | 
						|
)
 | 
						|
 | 
						|
// 检查是否为主程序
 | 
						|
func checkMain() bool {
 | 
						|
	if len(os.Args) == 1 ||
 | 
						|
		(len(os.Args) >= 2 && os.Args[1] == "pprof") {
 | 
						|
		return true
 | 
						|
	}
 | 
						|
	exe, _ := os.Executable()
 | 
						|
	return strings.HasSuffix(exe, ".test") ||
 | 
						|
		strings.HasSuffix(exe, ".test.exe") ||
 | 
						|
		strings.Contains(exe, "___")
 | 
						|
}
 |