Exemplo n.º 1
0
func RustDedicatedPath() string {
	switch runtime.GOOS {
	case "windows":
		return filepath.Join(utils.GetRustDir(), rustDedicatedWin)
	case "linux":
		return filepath.Join(utils.GetRustDir(), rustDedicatedLinux)
	default:
		return ""
	}

}
Exemplo n.º 2
0
func (m *Meld) InstallRust(args *InstallArgs, success *bool) error {
	m.mu.Lock()
	defer m.mu.Unlock()

	if args.SteamPath == "" {
		args.SteamPath = utils.GetSteamDir()
	}

	if args.RustPath == "" {
		args.RustPath = utils.GetRustDir()
	}

	// check for existing
	steamCmdPath, err := utils.GetSteamCmdPath(args.SteamPath)
	if err != nil {
		*success = false
		return fmt.Errorf("unable to find steam; perhaps try installing; err=%s", err)
	}

	if err := utils.InstallRust(steamCmdPath, args.RustPath, true); err != nil {
		*success = false
		return err
	}

	return nil
}
Exemplo n.º 3
0
func (m *Meld) InstallOxide(args *InstallArgs, success *bool) error {
	m.mu.Lock()
	defer m.mu.Unlock()

	if args.RustPath == "" {
		args.RustPath = utils.GetRustDir()
	}

	if err := utils.InstallOxideMod(args.RustPath); err != nil {
		*success = false
		return fmt.Errorf("error installing oxide: %s", err)
	}

	*success = true
	return nil
}