2023-07-26 11:13:45 +08:00
|
|
|
//----------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Licensed under Apache License Version 2.0, January 2004
|
|
|
|
//
|
|
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
package internal
|
|
|
|
|
|
|
|
import (
|
2023-09-03 18:40:44 +08:00
|
|
|
"github.com/energye/energy/v2/cmd/internal/command"
|
2023-09-05 19:45:30 +08:00
|
|
|
"github.com/energye/energy/v2/cmd/internal/consts"
|
2023-09-12 17:05:44 +08:00
|
|
|
"github.com/energye/energy/v2/cmd/internal/term"
|
2023-07-26 11:13:45 +08:00
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2023-09-03 18:40:44 +08:00
|
|
|
var CmdEnv = &command.Command{
|
2023-07-26 11:13:45 +08:00
|
|
|
UsageLine: "env",
|
2023-09-12 17:05:44 +08:00
|
|
|
Short: "Get ENERGY Framework Development Environment",
|
2023-07-26 11:13:45 +08:00
|
|
|
Long: `
|
|
|
|
. Execute default command
|
|
|
|
`,
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
CmdEnv.Run = runGetEnv
|
|
|
|
}
|
|
|
|
|
2023-09-03 18:40:44 +08:00
|
|
|
func runGetEnv(c *command.Config) error {
|
2023-09-12 17:05:44 +08:00
|
|
|
term.Section.Println(consts.GolanHomeKey, os.Getenv(consts.GolanHomeKey))
|
|
|
|
term.Section.Println(consts.EnergyHomeKey, os.Getenv(consts.EnergyHomeKey))
|
|
|
|
if consts.IsWindows {
|
|
|
|
term.Section.Println(consts.NSISHomeKey, os.Getenv(consts.NSISHomeKey))
|
|
|
|
term.Section.Println(consts.Z7ZHomeKey, os.Getenv(consts.Z7ZHomeKey))
|
|
|
|
}
|
|
|
|
if !consts.IsDarwin {
|
|
|
|
term.Section.Println(consts.UPXHomeKey, os.Getenv(consts.UPXHomeKey))
|
|
|
|
}
|
2023-07-26 11:13:45 +08:00
|
|
|
return nil
|
|
|
|
}
|