Documentation
¶
Index ¶
- Variables
- func BackupEnvPath() error
- func CreateSymlink(source, target string) error
- func GetConfigPath() (string, error)
- func GetDefaultBackupFilePath() string
- func GetDefaultSymlinkPath() string
- func InitializeConfig(configFilePath string) error
- func ResetConfig()
- func RestorePathFromBackup() error
- func SetConfigPath(path string)
- func ValidateJavaPath(path string) bool
- type Config
- type JDK
- type PathBackup
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BackupEnvPath ¶
func BackupEnvPath() error
BackupEnvPath creates a backup of the PATH environment variables On Windows, it backs up both user and system PATH variables
func CreateSymlink ¶
CreateSymlink creates a symbolic link from source to target
func GetConfigPath ¶
GetConfigPath returns the path to the config file
func GetDefaultBackupFilePath ¶
func GetDefaultBackupFilePath() string
func GetDefaultSymlinkPath ¶
func GetDefaultSymlinkPath() string
func InitializeConfig ¶
InitializeConfig 初始化配置文件,如果配置文件不存在则创建
func ResetConfig ¶
func ResetConfig()
func RestorePathFromBackup ¶
func RestorePathFromBackup() error
RestorePathFromBackup restores PATH environment variables from backup
func SetConfigPath ¶
func SetConfigPath(path string)
SetConfigPath sets a custom path for the config file
Types ¶
type Config ¶
type Config struct {
Current string `json:"current"`
SymlinkPath string `json:"symlink_path"`
Initialized bool `json:"initialized"`
EnvBackUpPath string `json:"env_backup_path"`
Jdks map[string]JDK `json:"jdks"` // 将数组改为 map
Theme string `json:"theme"` // Current theme name
// contains filtered or unexported fields
}
func (*Config) SetCurrentJDK ¶
SetCurrentJDK 设置当前JDK
func (*Config) SetSymlinkPath ¶
SetSymlinkPath 设置符号链接路径
type PathBackup ¶
type PathBackup struct {
UserPath string `json:"user_path,omitempty"`
SystemPath string `json:"system_path,omitempty"`
}
PathBackup represents the structure for backing up PATH environment variables
Click to show internal directories.
Click to hide internal directories.