Example #1
0
        /// <summary>
        /// Creates a symlink between destinationPath and sourcePath (Windows version).
        /// </summary>
        /// <param name="sourcePath"></param>
        /// <param name="destinationPath"></param>
        private static void CreateLinkWin(string sourcePath, string destinationPath)
        {
            string cmd = "/C mklink /J " + string.Format("\"{0}\" \"{1}\"", destinationPath, sourcePath);

            Debug.Log("Windows junction: " + cmd);
            ProjectCloner.StartHiddenConsoleProcess("cmd.exe", cmd);
        }
        /// <summary>
        /// Creates a symlink between destinationPath and sourcePath (Linux version).
        /// </summary>
        /// <param name="sourcePath"></param>
        /// <param name="destinationPath"></param>
        private static void CreateLinkLunux(string sourcePath, string destinationPath)
        {
            string cmd = string.Format("-c \"ln -s {0} {1}\"", sourcePath, destinationPath);

            Debug.Log("Linux junction: " + cmd);
            ProjectCloner.StartHiddenConsoleProcess("/bin/bash", cmd);
        }
        /// <summary>
        /// Creates a symlink between destinationPath and sourcePath (Windows version).
        /// </summary>
        /// <param name="sourcePath"></param>
        /// <param name="destinationPath"></param>
        private static void CreateLinkWin(string sourcePath, string destinationPath)
        {
            string cmd = $"/C mklink /J \"{destinationPath}\" \"{sourcePath}\"";

            Debug.Log($"Windows junction: {cmd}");
            ProjectCloner.StartHiddenConsoleProcess("cmd.exe", cmd);
        }
Example #4
0
        /// <summary>
        /// Creates a symlink between destinationPath and sourcePath (Mac version).
        /// </summary>
        /// <param name="sourcePath"></param>
        /// <param name="destinationPath"></param>
        private static void CreateLinkMac(string sourcePath, string destinationPath)
        {
            Debug.LogWarning("This hasn't been tested yet! I am mac-less :( Please chime in on the github if it works for you.");

            string cmd = "ln " + string.Format("\"{0}\" \"{1}\"", destinationPath, sourcePath);

            Debug.Log("Mac hard link " + cmd);

            ProjectCloner.StartHiddenConsoleProcess("/bin/bash", cmd);
        }
Example #5
0
        /// <summary>
        /// Opens a project located at the given path (if one exists).
        /// </summary>
        /// <param name="projectPath"></param>
        public static void OpenProject(string projectPath)
        {
            if (!Directory.Exists(projectPath))
            {
                Debug.LogError("Cannot open the project - provided folder (" + projectPath + ") does not exist.");
                return;
            }
            if (projectPath == ProjectCloner.GetCurrentProjectPath())
            {
                Debug.LogError("Cannot open the project - it is already open.");
                return;
            }

            string fileName = EditorApplication.applicationPath;
            string args     = "-projectPath \"" + projectPath + "\"";

            Debug.Log("Opening project \"" + fileName + " " + args + "\"");
            ProjectCloner.StartHiddenConsoleProcess(fileName, args);
        }