Functions | |
| std::string | run_command (const std::string &command) |
Runs command through the shell and returns everything it wrote to standard output (and standard error, since the two are merged so that a failing command's diagnostics end up in the error message below). | |
| std::optional< std::string > | get_env (const std::string &name) |
| Reads an environment variable. | |
NoTeX Copyright (c) 2026 Marco Tallone Licensed under the MIT License. See LICENCE for details.
Implements notex::system, wrapping ::popen/::pclose and std::getenv.
| std::optional< std::string > notex::system::get_env | ( | const std::string & | name | ) |
Reads an environment variable.
| name | Name of the environment variable to read. |
Definition at line 52 of file system.cpp.
| std::string notex::system::run_command | ( | const std::string & | command | ) |
Runs command through the shell and returns everything it wrote to standard output (and standard error, since the two are merged so that a failing command's diagnostics end up in the error message below).
| command | Shell command line to execute. |
| NotexError | if the command could not be started, or exited with a non-zero status. Callers that expect failure to be routine (for example, a database-refresh tool that may be absent) are expected to catch this and downgrade it rather than propagate it. |
Definition at line 19 of file system.cpp.
References notex::FAILURE.
Referenced by notex::Installer::install_global(), and notex::Installer::uninstall_global().