Ejemplo n.º 1
0
        /// <summary>
        /// When a button update version is clicked this function is called that upgrades the version.
        /// </summary>
        public void UpdateVersion()
        {
            if (!EditorUserBuildSettings.development && (EditorUserBuildSettings.activeBuildTarget != BuildTarget.iOS || EditorUserBuildSettings.activeBuildTarget != BuildTarget.StandaloneOSX))
            {
                ///c/Users/kaime/Documents/00_MOKSLAI/Graduation/TBS/tbs/tbs unity prepare
                GitHande.RunGitCommand("tbs unity prepare");

                if (!FileReaderWriter.FailGitSafeRead())
                {
                    return;
                }
            }

            //check if we have version file
            if (!EditorUserBuildSettings.development)
            {
                if (FileReaderWriter.CheckIfFileExists(_pathVersion))
                {
                    UpgradeVersionPopWindow.OpenWindow();
                }
                else
                {
                    VersionPopUpWindow.OpenWindow();
                    Debug.LogError("Version file doesn't exists. Please create a new one.");
                }
            }
            else
            {
                Debug.LogError("Sorry you are in develop. Can't upgrade the version.");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a VERSION file. If repository does not have a tag then it will create a tag and a file.
        /// </summary>
        public void CreateNewVersionFile()
        {
            //GitHande.RunGitCommand("/c/Users/kaime/Documents/00_MOKSLAI/Graduation/TBS/tbs/tbs unity version v0.1.0");
            GitHande.RunGitCommand("tbs unity version v0.1.0b1");

            if (!FileReaderWriter.FailGitSafeRead())
            {
                return;
            }

            if (!FileReaderWriter.CheckIfFileExists(_pathVersion))
            {
                Debug.Log("<b><color=red> File was not created. Is your repo clean?</color></b>");
                return;
            }
            Debug.Log("<b><color=green> File was created.</color></b>");

            //check the version of file and compare to current in unity
            if (!EditorUserBuildSettings.development)
            {
                UpgradeVersionPopWindow.OpenWindow();
            }
        }