コード例 #1
0
 private static void OpenExplorer()
 {
     if (CommonUtilities.IsWindows)
     {
         Cmd.Run("start .");
     }
     else
     {
         Cmd.Run("open .");
     }
 }
コード例 #2
0
 private static void OpenBash()
 {
     if (CommonUtilities.IsWindows)
     {
         Cmd.Run("start bash");
     }
     else
     {
         Cmd.Run("open /bin/bash");
     }
 }
コード例 #3
0
        private static void TagCurrentVersion()
        {
            var version = Versioning.CurrentVersion;

            if (!EditorUtility.DisplayDialog("Tag 'n' Push", "Are you sure you want to tag and push the current commit? This will cause a release on GitHub by Travis CI", "Tag", "Cancel"))
            {
                return;
            }

            Cmd.Run("git push origin :refs/tags/v{0}", version);
            Cmd.Run("git tag -f -a -m \"Version {0}\" v{0}", version);
            Cmd.Run("git push --tags"); // This will cause a release in Travis CI
        }
コード例 #4
0
        private static void OpenWith(string unity)
        {
            var projPath = Cmd.Run("cd") + string.Format(@"\Cloned\{0}", unity.GetHashCode());

            Cmd.Run("if exist \"{0}\" rmdir /S /Q \"{0}\"", projPath);
            Cmd.Run("mkdir \"{0}\"", projPath);
            Cmd.Run("mkdir \"{0}\\Assets\"", projPath);
            foreach (var folder in foldersToLink)
            {
                Cmd.Run("mklink /J \"{0}\\{1}\" \"{1}\"", projPath, folder);
            }
            Cmd.Run("\"{0}\" -projectPath \"{1}\" -disable-assembly-updater -username \"{2}\" -password \"{3}\"", unity, projPath, USERNAME, PASSWORD);
            Cmd.Run("if exist \"{0}\" rmdir /S /Q \"{0}\"", projPath);
        }
コード例 #5
0
        private static void LinkProject()
        {
            if (!CommonUtilities.IsWindows)
            {
                Debug.LogError("Not supported on this platform");
                return;
            }

            var link   = EditorUtility.SaveFilePanel("Select folder to save link", "../Assets", SharedToolsMetadata.ST_PLUGIN_NAME, "");
            var target = Path.GetFullPath(SharedToolsMetadata.ST_ROOT_FOLDER);

            if (string.IsNullOrEmpty(link))
            {
                return;
            }

            Cmd.Run("mklink /D \"{0}\" \"{1}\"", true, link, target);
        }
コード例 #6
0
        private static void CopyPackage()
        {
            AssetStoreToolsCallbacks.beforeUpload += (sender, next) => {
                if (Versioning.CurrentVersion == Versioning.ReleasedVersion)
                {
                    Debug.LogError("The current version is the same as the published version");
                    return;
                }

                Versioning.UpdateTime();
                next();
            };

            if (!Directory.Exists("Releases/"))
            {
                return;
            }

            AssetStoreToolsCallbacks.afterPackageExport += (sender, package) => {
                After.Condition(
                    () => File.Exists(package),
                    () => {
                    var dst = string.Format("Releases/{1}-v{0}.unitypackage", Versioning.CurrentVersion, SharedToolsMetadata.ST_PLUGIN_SLUG);

                    if (File.Exists(dst))
                    {
                        if (new FileInfo(dst).Length == new FileInfo(package).Length)
                        {
                            return;
                        }

                        File.Delete(dst);
                    }

                    File.Copy(package, dst);
                    Cmd.Run("git add {0}", dst);
                    Debug.LogFormat("Copied {0} to {1}", package, dst);
                },
                    60000
                    );
            };
        }
コード例 #7
0
 private static void UploadSharedTools()
 {
     Cmd.Run("cd Assets/SharedTools && git push origin HEAD:master");
 }
コード例 #8
0
 private static void UpdateSharedTools()
 {
     Cmd.Run("cd Assets/SharedTools && git pull origin master");
 }
コード例 #9
0
 private static void OpenCmd()
 {
     Cmd.Run("start cmd");
 }
コード例 #10
0
 private static void OpenVSCode()
 {
     Cmd.Run("code .");
 }