Example #1
0
        bool Execute(string filename)
        {
            try
            {
                if (edit)
                {
                    string configPath = CConfigHelper.GetConfigPath(filename);
                    if (!CFileUtils.FileExists(configPath))
                    {
                        PrintError("File does not exist: {0}", configPath);
                        return(false);
                    }

                    EditorUtility.OpenWithDefaultApp(configPath);
                    return(true);
                }

                IList <string> lines = CConfigHelper.ReadConfig(filename);
                foreach (string line in lines)
                {
                    PrintIndent(line);
                }

                return(true);
            }
            catch (Exception e)
            {
                PrintIndent("Can't read config: {0}", e.Message);
                return(false);
            }
        }
Example #2
0
        bool Execute(string filename)
        {
            try
            {
                IList <string> lines = CConfigHelper.ReadConfig(filename);
                foreach (string line in lines)
                {
                    string trim = line.Trim();
                    if (trim.Length == 0 || trim.StartsWith("//"))
                    {
                        continue;
                    }

                    ExecCommand(line);
                }

                PostNotification(CCommandNotifications.ConfigLoaded);

                return(true);
            }
            catch (Exception e)
            {
                if (this.IsManualMode)
                {
                    PrintError("Can't load config: {0}", e);
                }

                return(false);
            }
        }