/// <summary> /// Scans the ksp instance. Detects installed mods to mark as auto-detected and checks the consistency /// </summary> /// <param name="ksp_instance">The instance to scan</param> /// <param name="user"></param> /// <param name="next_command">Changes the output message if set.</param> /// <returns>Exit.OK if instance is consistent, Exit.ERROR otherwise </returns> private static int Scan(CKAN.KSP ksp_instance, IUser user, string next_command = null) { try { ksp_instance.ScanGameData(); return(Exit.OK); } catch (InconsistentKraken kraken) { if (next_command == null) { user.RaiseError(kraken.InconsistenciesPretty); user.RaiseError("The repo has not been saved."); } else { user.RaiseMessage("Preliminary scanning shows that the install is in a inconsistent state."); user.RaiseMessage("Use ckan.exe scan for more details"); user.RaiseMessage("Proceeding with {0} in case it fixes it.\r\n", next_command); } return(Exit.ERROR); } }
private static int Scan(CKAN.KSP current_instance) { current_instance.ScanGameData(); return Exit.OK; }