Exemplo n.º 1
0
        public static void Restart()
        {
            _colorify.Clear();

            try
            {
                Section.Header("ADB KILL/RESTART");

                if (_config.personal.adb.wifiStatus)
                {
                    _colorify.WriteLine($" --> Disconnecting device...", txtInfo);
                    CmdDisconnect(_config.personal.adb.wifiIpAddress, _config.personal.adb.wifiPort);
                    _config.personal.adb.wifiStatus = false;
                    _colorify.BlankLines();
                }

                _colorify.WriteLine($" --> Kill Server...", txtInfo);
                CmdKillServer();

                _colorify.BlankLines();
                _colorify.WriteLine($" --> Start Server...", txtInfo);
                CmdStartServer();

                _config.personal.adb.deviceName = "";

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 2
0
        public static void Environment()
        {
            Variables.Upgrade();
            Variables.Update();

            _colorify.Clear();

            Section.Header("ENVIRONMENT VARIABLES");

            foreach (var v in Variables.list)
            {
                _colorify.Write($"{$" {v.name}:",-21}", txtPrimary);
                if (v.status)
                {
                    _colorify.WriteLine($"{v.value}");
                }
                else
                {
                    _colorify.WriteLine("is not defined", txtWarning);
                }
            }

            Section.HorizontalRule();
            Section.Pause();

            Menu.Start();
        }
Exemplo n.º 3
0
        public static void AndroidCompact()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "ANDROID", "COMPACT");

                _colorify.WriteLine($" Files path inside Selected Project to be compacted.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.project.androidHybridPath = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 4
0
        public static void AndroidMappingSuffix()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "ANDROID", "MAPPING SUFFIX");

                _colorify.WriteLine($" Suffix name and extension inside Build folder.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.project.androidMappingSuffix = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 5
0
        public static void AndroidExtension()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "ANDROID", "EXTENSION");

                _colorify.WriteLine($" File extension inside Build folder.", txtPrimary);
                _colorify.WriteLine($" Don't use . (dot character) at start.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.project.androidBuildExtension = $".{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 6
0
        public static void IosProject()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "PROJECT", "IOS");

                _colorify.WriteLine($" iOS folder inside selected project path.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.project.iosPath = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 7
0
        public static void VpnSiteName()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "VPN");

                _colorify.WriteLine($" Site name for VPN connection.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.vpn.siteName = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 8
0
        public static void Filter()
        {
            _colorify.Clear();

            try
            {
                Section.Header("LOGCAT", "FILTER");

                Section.SelectedFile();
                Section.SelectedPackageName();

                _colorify.BlankLines();
                _colorify.WriteLine($" Write filter.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Remove",82}", txtWarning);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                _config.personal.logcat.filter = $"{opt}";

                Menu.Status();
                SelectLogcat();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 9
0
        public static void Init()
        {
            _colorify.Clear();

            try
            {
                Section.Header("BUILD CONFIGURATION", "INIT");

                string dirPath = _path.Combine(
                    _config.path.development,
                    _config.path.workspace,
                    _config.path.project,
                    _config.personal.selected.project
                    );

                _colorify.WriteLine($" --> Updating Dependencies...", txtInfo);
                Build.CmdRemove(dirPath);
                Build.CmdInstall(dirPath);

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 10
0
        public static void Domain()
        {
            _colorify.Clear();

            try
            {
                Section.Header("SONAR CONFIGURATION", "SERVER", "DOMAIN");
                Section.SelectedProject();
                Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration);

                _colorify.BlankLines();
                _colorify.WriteLine($" Write server domain.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();

                if (!String.IsNullOrEmpty(opt))
                {
                    _config.personal.sonar.domain = opt;
                }

                Menu.Status();
                Server();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 11
0
        public static void Make()
        {
            _colorify.Clear();

            try
            {
                Section.Header("TASK", "MAKE");
                Section.SelectedProject();
                Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration);

                string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project);

                _colorify.BlankLines();
                _colorify.WriteLine($" --> Making...", txtInfo);
                CmdMake(dirPath);

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 12
0
        public static void Update()
        {
            _colorify.Clear();

            try
            {
                Section.Header("TASK", "UPDATE");

                string dirPath = _path.Combine(Variables.Value("task_project"));

                _colorify.WriteLine($" --> Updating...", txtInfo);
                Git.CmdPull(dirPath);

                _colorify.BlankLines();
                _colorify.WriteLine($" --> Updating Dependencies...", txtInfo);
                Task.CmdRemove();
                Task.CmdInstall();

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 13
0
        public static void InternalPath()
        {
            _colorify.Clear();

            try
            {
                Section.Header("SONAR CONFIGURATION", "INTERNAL PATH");
                Section.SelectedProject();
                Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration);

                _colorify.BlankLines();
                _colorify.WriteLine($" Write an internal path inside your project.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Remove",82}", txtWarning);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                _config.personal.sonar.internalPath = $"{opt}";

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 14
0
        public static void Listening()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONNECT DEVICE", "LISTENING PORT");

                _colorify.BlankLines();
                _colorify.WriteLine($" --> Checking devices...", txtInfo);
                if (CmdDevices())
                {
                    _colorify.BlankLines();
                    _colorify.WriteLine($" --> Changing port...", txtInfo);
                    Response result = CmdTcpIp(_config.personal.adb.wifiPort, _config.personal.adb.deviceName);
                    if (result.code == 0)
                    {
                        _colorify.WriteLine($" --> Restarting...", txtInfo);
                        _colorify.BlankLines();
                        _colorify.WriteLine($" TCP mode port: {_config.personal.adb.wifiPort}");
                    }

                    Section.HorizontalRule();
                    Section.Pause();
                }
                else
                {
                    Message.Alert(" No device/emulators found");
                }
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 15
0
        public static void PathFilter()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "PATH", "FILTER");

                _colorify.WriteLine($" Filter for folders inside Projects path.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary);
                _colorify.WriteLine($" Can use * as wildcard.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.path.filter = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 16
0
        public static void CoveragePath()
        {
            _colorify.Clear();

            try
            {
                Section.Header("TASK", "TEST", "COVERAGE");

                _colorify.WriteLine($" Coverage configuration path inside path.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.personal.testServer.coveragePath = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 17
0
        public static void Base()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONNECT DEVICE", "IP ADDRESS");

                _colorify.BlankLines();
                _colorify.WriteLine($" Write last mobile device IP octet.", txtPrimary);
                _colorify.WriteLine($" PC and Mobile device needs to be in same WiFi Network.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _config.personal.ipAddressBase = Network.GetOctetsIPv4(_config.personal.ipAddress, 3);
                _colorify.Write($"{$" {_config.personal.ipAddressBase} ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();

                if (!String.IsNullOrEmpty(opt))
                {
                    Number.IsOnRange(1, Convert.ToInt32(opt), 255);
                    _config.personal.adb.wifiIpAddress = $"{_config.personal.ipAddressBase}{opt}";
                }

                Menu.Status();
                SelectWireless();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 18
0
        public static void PathLog()
        {
            _colorify.Clear();

            try
            {
                Section.Header("TASK", "PATH", "LOG");

                _colorify.WriteLine($" Log configuration path inside path.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Write your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    _config.task.logFolder = $"{opt}";
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 19
0
        public static void Disconnect()
        {
            _colorify.Clear();

            try
            {
                Section.Header("DISCONNECT DEVICE");

                _colorify.WriteLine($" --> Disconnecting...", txtInfo);
                bool connected = CmdDisconnect(_config.personal.adb.wifiIpAddress, _config.personal.adb.wifiPort);
                _config.personal.adb.wifiStatus = connected;
                if (_config.personal.adb.deviceName == $"{_config.personal.adb.wifiIpAddress}:{_config.personal.adb.wifiPort}")
                {
                    _config.personal.adb.deviceName = "";
                }

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 20
0
        public static void Connect()
        {
            if (!String.IsNullOrEmpty(_config.personal.adb.wifiIpAddress))
            {
                _colorify.Clear();

                try
                {
                    Section.Header("CONNECT DEVICE", "CONNECT");

                    _colorify.WriteLine($" --> Connecting...", txtInfo);
                    bool connected = CmdConnect(_config.personal.adb.wifiIpAddress, _config.personal.adb.wifiPort);
                    _config.personal.adb.wifiStatus = connected;

                    Section.HorizontalRule();
                    Section.Pause();

                    Menu.Start();
                }
                catch (Exception Ex)
                {
                    Exceptions.General(Ex);
                }
            }
        }
Exemplo n.º 21
0
        public static void Revert()
        {
            _colorify.Clear();

            try
            {
                Section.Header("TASK", "REVERT");
                Section.SelectedProject();
                Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration);

                string dirPath   = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project, _config.project.androidPath, _config.project.androidHybridPath);
                string dirSource = _path.Combine(Variables.Value("task_project"), "service/www");
                _colorify.BlankLines();
                _colorify.WriteLine($" --> Reverting...", txtInfo);
                _colorify.Write($"{" From:",-8}", txtMuted); _colorify.WriteLine($"{dirSource}");
                _colorify.Write($"{" To:",-8}", txtMuted); _colorify.WriteLine($"{dirPath}");
                _disk.CopyAll(dirSource, dirPath, true);

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 22
0
        public static void Start()
        {
            _colorify.Clear();

            string name    = Assembly.GetEntryAssembly().GetName().Name.ToUpper().ToString();
            string version = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion;

            Section.Header($" {name} # {version}|{_config.personal.hostName} : {_config.personal.ipAddress} ");

            Status("m");
            Project.Start();
            Git.Start();
            Task.Start();
            Build.Start();
            Sonar.Start();
            Adb.Start();

            Section.Footer();

            Section.HorizontalRule();

            _colorify.Write($"{" Make your choice:",-25}", txtInfo);
            string opt = Console.ReadLine().Trim();

            _colorify.Clear();
            Route(opt);
        }
Exemplo n.º 23
0
        public static void SelectFile()
        {
            _colorify.Clear();

            try
            {
                Section.Header("PROJECT", "SELECT FILE");

                string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project, _config.project.androidPath, _config.project.androidBuildPath);
                dirPath.Exists("Please review your configuration file or make a build first.");
                List <string> files = dirPath.Files($"*{_config.project.androidBuildExtension}", "Please make a build first.", SearchOption.AllDirectories);

                if (files.Count < 1)
                {
                    _config.personal.selected.path        = "";
                    _config.personal.selected.file        = "";
                    _config.personal.selected.packageName = "";
                    _config.personal.selected.versionCode = "";
                    _config.personal.selected.versionName = "";
                }
                else
                {
                    var i = 1;
                    foreach (var file in files)
                    {
                        string f = file;
                        _colorify.WriteLine($" {i,2}] {_path.GetFileName(f)}", txtPrimary);
                        i++;
                    }
                }

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice:",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();

                if (!String.IsNullOrEmpty(opt))
                {
                    Number.IsOnRange(1, Convert.ToInt32(opt), files.Count);
                    var sel = files[Convert.ToInt32(opt) - 1];
                    _config.personal.selected.path        = _path.Split(_path.GetDirectoryName(sel), dirPath);
                    _config.personal.selected.file        = _path.GetFileName(sel);
                    _config.personal.selected.mapping     = _config.personal.selected.file.Replace(_config.project.androidBuildExtension, _config.project.androidMappingSuffix);
                    _config.personal.selected.packageName = BuildTools.CmdGetPackage(sel, "name", 1);
                    _config.personal.selected.versionCode = BuildTools.CmdGetPackage(sel, "versionCode", 2);
                    _config.personal.selected.versionName = BuildTools.CmdGetPackage(sel, "versionName", 3);
                }

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 24
0
        public static void Devices()
        {
            _colorify.Clear();

            try
            {
                Section.Header("DEVICE LIST");

                if (CmdDevices())
                {
                    string   list  = CmdList();
                    string[] lines = Transform.Strings.SplitLines(list);

                    if (lines.Length >= 1)
                    {
                        var i = 1;
                        foreach (string l in lines)
                        {
                            if (!String.IsNullOrEmpty(l))
                            {
                                _colorify.WriteLine($" {i,2}] {Transform.Strings.GetWord(l, 0)}", txtPrimary);
                                i++;
                            }
                        }
                    }

                    _colorify.BlankLines();
                    _colorify.WriteLine($"{"[EMPTY] None",82}", txtDanger);

                    Section.HorizontalRule();

                    _colorify.Write($"{" Make your choice:",-25}", txtInfo);
                    string opt = Console.ReadLine().Trim();

                    if (!String.IsNullOrEmpty(opt))
                    {
                        Validations.Number.IsOnRange(1, Convert.ToInt32(opt), list.Length);
                        var sel = Transform.Strings.GetWord(lines[Convert.ToInt32(opt) - 1], 0);
                        _config.personal.adb.deviceName = sel;
                    }
                    else
                    {
                        _config.personal.adb.deviceName = "";
                    }
                }
                else
                {
                    _config.personal.adb.deviceName = "";
                    Message.Alert(" No device found.");
                }

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 25
0
        public static void Select()
        {
            _colorify.Clear();

            Section.Header("CONFIGURATION");

            _colorify.WriteLine($" [M] Main Path", txtMuted);
            _colorify.Write($"{"   [D] Development",-25}", txtPrimary); _colorify.WriteLine($"{_config.path.development}");
            _colorify.Write($"{"   [W] Workspace",-25}", txtPrimary); _colorify.WriteLine($"{_config.path.workspace}");
            _colorify.Write($"{"   [P] Projects",-25}", txtPrimary); _colorify.WriteLine($"{_config.path.project}");
            _colorify.Write($"{"   [F] Filter",-25}", txtPrimary); _colorify.WriteLine($"{_config.path.filter}");

            _colorify.BlankLines();
            _colorify.WriteLine($" [P] Project Path", txtMuted);
            _colorify.Write($"{"   [I] iOS",-25}", txtPrimary); _colorify.WriteLine($"{_config.project.iosPath}");
            _colorify.Write($"{"   [A] Android",-25}", txtPrimary); _colorify.WriteLine($"{_config.project.androidPath}");
            _colorify.Write($"{"   [B] Build",-25}", txtPrimary); _colorify.WriteLine($"{_config.project.androidBuildPath}");
            _colorify.Write($"{"   [E] Extension",-25}", txtPrimary); _colorify.WriteLine($"{_config.project.androidBuildExtension}");
            _colorify.Write($"{"   [M] Mapping",-25}", txtPrimary); _colorify.WriteLine($"{_config.project.androidMappingSuffix}");
            _colorify.Write($"{"   [C] Compact",-25}", txtPrimary); _colorify.WriteLine($"{_config.project.androidHybridPath}");
            _colorify.Write($"{"   [F] Filter",-25}", txtPrimary); _colorify.WriteLine($"{string.Join(",", _config.project.filterFiles)}");

            _colorify.BlankLines();
            string selectedEditor = Selector.Name(Selector.Editor, _config.editor.selected);

            _colorify.Write($"{" [E] Editor",-25}", txtPrimary); _colorify.WriteLine($"{selectedEditor}");
            _colorify.Write($"{" [V] VPN",-25}", txtStatus(OS.IsWin())); _colorify.WriteLine($"{_config.vpn.siteName}");
            string selectedTheme = Selector.Name(Selector.Theme, _config.personal.theme);

            _colorify.Write($"{" [T] Theme",-25}", txtPrimary); _colorify.WriteLine($"{selectedTheme}");
            string statusLog = Selector.Name(Selector.Status, (_config.personal.log ? "e" : "d"));

            _colorify.Write($"{" [L] Log",-25}", txtPrimary); _colorify.WriteLine($"{statusLog}");

            _colorify.BlankLines();
            _colorify.WriteLine($"{"[EMPTY] Save",82}", txtSuccess);

            Section.HorizontalRule();

            _colorify.Write($"{" Make your choice:",-25}", txtInfo);
            string opt = Console.ReadLine()?.ToLower();

            if (String.IsNullOrEmpty(opt))
            {
                Settings.Save(_config);
                Menu.Start();
            }
            else
            {
                Menu.Route($"c>{opt}", "c");
            }
            Message.Error();
        }
Exemplo n.º 26
0
        public static void Select()
        {
            _colorify.Clear();

            try
            {
                Section.Header("TASK", "CONFIGURATION");

                _colorify.WriteLine($" [P]", txtMuted);
                _colorify.Write($"{"   [W] Web Server",-25}", txtPrimary); _colorify.WriteLine($"{_config.task.webFolder}");
                _colorify.Write($"{"   [L] Log",-25}", txtPrimary); _colorify.WriteLine($"{_config.task.logFolder}");
                _colorify.Write($"{"   [E] Extension",-25}", txtPrimary); _colorify.WriteLine($"{_config.task.extension}");

                _colorify.BlankLines();
                _colorify.WriteLine($" [S] Server (Web/Log)", txtMuted);
                _colorify.Write($"{"   [I] Internal Path:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.webServer.internalPath}");
                _colorify.Write($"{"   [C] Configuration:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.webServer.file}");
                string taskConfiguration = Selector.Name(Selector.Flavor, _config.personal.webServer.flavor);
                _colorify.Write($"{"   [F] Flavor:",-25}", txtPrimary); _colorify.WriteLine($"{taskConfiguration}");
                _colorify.Write($"{"   [N] Number:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.webServer.number}");
                _colorify.Write($"{"   [S] Sync:",-25}", txtPrimary); _colorify.WriteLine($"{(_config.personal.webServer.sync ? "Yes" : "No")}");
                _colorify.Write($"{"   [O] Open:",-25}", txtPrimary); _colorify.WriteLine($"{(_config.personal.webServer.open ? "Yes" : "No")}");

                _colorify.BlankLines();
                _colorify.WriteLine($" [T] Test", txtMuted);
                _colorify.Write($"{"   [S] Sync:",-25}", txtPrimary); _colorify.WriteLine($"{(_config.personal.testServer.sync ? "Yes" : "No")}");
                _colorify.Write($"{"   [C] Coverage Path:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.testServer.coveragePath}");

                _colorify.WriteLine($"{"[EMPTY] Exit",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice:",-25}", txtInfo);
                string opt = Console.ReadLine()?.ToLower();

                if (String.IsNullOrEmpty(opt))
                {
                    Menu.Start();
                }
                else
                {
                    Menu.Route($"t>{opt}", "t");
                }
                Message.Error();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 27
0
        public static void Select()
        {
            _colorify.Clear();

            try
            {
                Section.Header("SELECT PROJECT");

                string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project);
                dirPath.Exists("Please review your configuration file.");
                List <string> dirs = dirPath.Directories(_config.path.filter, "projects");

                if (dirs.Count < 1)
                {
                    _config.personal.selected.project = "";
                }
                else
                {
                    var i = 1;
                    foreach (var dir in dirs)
                    {
                        string d = dir;
                        _colorify.WriteLine($" {i,2}] {_path.GetFileName(d)}", txtPrimary);
                        i++;
                    }
                }

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice:",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();

                if (!String.IsNullOrEmpty(opt))
                {
                    Number.IsOnRange(1, Convert.ToInt32(opt), dirs.Count);

                    var sel = dirs[Convert.ToInt32(opt) - 1];
                    _config.personal.selected.project = _path.GetFileName(sel);
                }

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 28
0
        public static void Actions(bool discard, bool pull, bool reset, bool confirm)
        {
            _colorify.Clear();

            try
            {
                Section.Header("GIT");
                Section.SelectedProject();

                string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project);

                if (discard)
                {
                    _colorify.BlankLines();
                    _colorify.WriteLine($" --> Discarding...", txtInfo);
                    Git.CmdDiscard(dirPath);
                }

                if (reset)
                {
                    _colorify.BlankLines();
                    _colorify.WriteLine($" --> Reseting...", txtInfo);
                    Git.CmdReset(dirPath);
                }

                if (pull)
                {
                    _colorify.BlankLines();
                    _colorify.WriteLine($" --> Updating...", txtInfo);
                    Git.CmdPull(dirPath);
                }

                if (confirm)
                {
                    _colorify.BlankLines();
                    _colorify.WriteLine($" --> Confirm update...", txtInfo);
                    Git.CmdPull(dirPath);
                }

                Section.HorizontalRule();
                Section.Pause();

                Menu.Start();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }
Exemplo n.º 29
0
        public static string Start(IReadOnlyDictionary <string, string> sel, string dfl)
        {
            string opt = "";

            try
            {
                dfl = dfl.ToLower();

                _colorify.BlankLines();
                foreach (var item in sel)
                {
                    if (item.Key == dfl)
                    {
                        _colorify.Write($" {item.Key.ToUpper(),2}] {item.Value}", txtPrimary);
                        _colorify.WriteLine($" (Default)", txtInfo);
                    }
                    else
                    {
                        _colorify.WriteLine($" {item.Key.ToUpper(),2}] {item.Value}", txtPrimary);
                    }
                }
                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Default",82}", txtInfo);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice: ",-25}", txtInfo);

                opt = Console.ReadLine()?.ToLower();

                if (String.IsNullOrEmpty(opt))
                {
                    opt = dfl;
                }
                else
                {
                    if (!sel.ContainsKey(opt))
                    {
                        Message.Error();
                    }
                }
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
            return(opt);
        }
Exemplo n.º 30
0
        public static void PathDevelopment()
        {
            _colorify.Clear();

            try
            {
                Section.Header("CONFIGURATION", "PATH", "DEVELOPMENT");

                _colorify.WriteLine($" Write main Development path.", txtPrimary);
                _colorify.WriteLine($" Don't use / (slash character) at end.", txtPrimary);

                _colorify.BlankLines();
                _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger);

                Section.HorizontalRule();

                _colorify.Write($"{" Make your choice: ",-25}", txtInfo);
                string opt = Console.ReadLine().Trim();
                if (!String.IsNullOrEmpty(opt))
                {
                    string dirPath = _path.Combine(opt);
                    if (!_fileSystem.DirectoryExists(dirPath))
                    {
                        StringBuilder msg = new StringBuilder();
                        msg.Append($" Path not found: {Environment.NewLine}");
                        msg.Append($" '{dirPath}'{Environment.NewLine}");

                        Message.Error(
                            msg: msg.ToString(),
                            replace: true
                            );
                    }
                    else
                    {
                        _config.path.development = $"{opt}";
                        _config.path.workspace   = "";
                    }
                }

                Menu.Status();
                Select();
            }
            catch (Exception Ex)
            {
                Exceptions.General(Ex);
            }
        }