Polyphase Game Engine
Loading...
Searching...
No Matches
ShellPresets.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include <string>
6#include <vector>
7
15enum class ShellPreset
16{
17 Auto = 0, // Pick a sensible default per platform
18 Custom = 1, // Use mCustomExe + parsed mCustomArgs
19 Cmd = 2, // Windows: cmd.exe
20 PowerShell = 3, // Windows: powershell.exe (Windows-bundled v5.1)
21 Pwsh = 4, // Cross-platform PowerShell 7+
22 GitBash = 5, // Windows: probes Git for Windows install paths
23 Msys2Bash = 6, // Windows: probes msys64/msys32 install paths
24 Bash = 7, // POSIX: /bin/bash
25 Zsh = 8, // POSIX: /bin/zsh
26 Sh = 9, // POSIX: /bin/sh
27 Count
28};
29
31struct ResolvedShell
32{
33 std::string mExecutable;
34 std::vector<std::string> mArgs;
35 std::vector<std::pair<std::string, std::string>> mExtraEnv; // e.g. MSYSTEM=MSYS for Msys2Bash
36 bool mResolved = false;
37 std::string mError; // populated when mResolved == false
38};
39
41ResolvedShell ResolveShellPreset(ShellPreset preset,
42 const std::string& customExe,
43 const std::vector<std::string>& customArgs);
44
46const char* ShellPresetDisplayName(ShellPreset preset);
47
49std::vector<std::string> SplitCommandLine(const std::string& line);
50
51#endif