// RunSetup ... func RunSetup(appVersion string, isFullSetupMode bool) error { log.Infoln("Setup") log.Infof("Full setup: %v", isFullSetupMode) log.Infoln("Detected OS:", runtime.GOOS) switch runtime.GOOS { case "darwin": if err := doSetupOnOSX(isFullSetupMode); err != nil { return err } case "linux": if err := doSetupOnLinux(); err != nil { return err } default: return errors.New("unsupported platform :(") } if err := configs.SaveSetupSuccessForVersion(appVersion); err != nil { return fmt.Errorf("failed to save setup-success into config file, error: %s", err) } // guide log.Infoln("We're ready to rock!!") fmt.Println() return nil }
// RunSetup ... func RunSetup(appVersion string, isFullSetupMode bool) error { log.Infoln("Setup") log.Infof("Full setup: %v", isFullSetupMode) log.Infoln("Detected OS:", runtime.GOOS) if err := doSetupBitriseCoreTools(); err != nil { return fmt.Errorf("Failed to do common/platform independent setup, error: %s", err) } switch runtime.GOOS { case "darwin": if err := doSetupOnOSX(isFullSetupMode); err != nil { return fmt.Errorf("Failed to do MacOS specific setup, error: %s", err) } case "linux": default: return errors.New("unsupported platform :(") } if err := doSetupPlugins(); err != nil { return fmt.Errorf("Failed to do Plugins setup, error: %s", err) } if err := doSetupToolkits(); err != nil { return fmt.Errorf("Failed to do Toolkits setup, error: %s", err) } log.Infoln("All the required tools are installed!") if err := configs.SaveSetupSuccessForVersion(appVersion); err != nil { return fmt.Errorf("failed to save setup-success into config file, error: %s", err) } // guide log.Infoln("We're ready to rock!!") fmt.Println() return nil }