| 305 | } |
| 306 | |
| 307 | void prepend_import_path(const std::string &script, cs::process_context *context) |
| 308 | { |
| 309 | if (script.empty()) { |
| 310 | return; |
| 311 | } |
| 312 | |
| 313 | if (cs_impl::file_system::is_absolute_path(script)) { |
| 314 | // If it's absolute path |
| 315 | auto pos = script.find_last_of(cs::path_separator); |
| 316 | |
| 317 | // in case of: /main.csc |
| 318 | if (pos > 0) { |
| 319 | context->import_path = script.substr(0, pos) + cs::path_delimiter + context->import_path; |
| 320 | } |
| 321 | else { |
| 322 | context->import_path = std::to_string(cs::path_separator) + cs::path_delimiter + context->import_path; |
| 323 | } |
| 324 | } |
| 325 | else { |
| 326 | // If it's relative path |
| 327 | prepend_import_path(cs_impl::file_system::get_current_dir() + cs::path_separator + script, context); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | array parse_cmd_args(int argc, char *argv[]) |
| 332 | { |
no test coverage detected