diff --git a/cmd/tools/amalgamate.v b/cmd/tools/amalgamate.v index 9fd2a243e3..d5e95b7670 100644 --- a/cmd/tools/amalgamate.v +++ b/cmd/tools/amalgamate.v @@ -109,7 +109,7 @@ fn (mut c Context) amalgamate() ! { if c.config.input_files.len == 0 { // source += '/* ########## stdin */\n' // if there are no input files, read from stdin - local_dir := os.get_current_dir() + local_dir := os.getwd() source += c.handle_includes(local_dir, os.get_raw_lines_joined())! // source += '/* ########## stdin end */\n' } else { diff --git a/cmd/tools/bench/map_clear_runner.vsh b/cmd/tools/bench/map_clear_runner.vsh index 6ce3730489..0c82cc82fd 100755 --- a/cmd/tools/bench/map_clear_runner.vsh +++ b/cmd/tools/bench/map_clear_runner.vsh @@ -14,7 +14,7 @@ step := os.args[3] or { '500_000' }.int() os.chdir(os.dir(@VEXE))! vcmd := 'v ${flags} cmd/tools/bench/map_clear.v' -println('>> start: ${start} | end: ${end} | step: ${step} | workdir: "${os.get_current_dir()}" | flags: "${flags}" | vcmd: "${vcmd}"') +println('>> start: ${start} | end: ${end} | step: ${step} | workdir: "${os.getwd()}" | flags: "${flags}" | vcmd: "${vcmd}"') assert os.system(vcmd) == 0 println('running...') diff --git a/cmd/tools/fast/fast_job.v b/cmd/tools/fast/fast_job.v index b49564a4dc..542bf01fde 100644 --- a/cmd/tools/fast/fast_job.v +++ b/cmd/tools/fast/fast_job.v @@ -53,7 +53,7 @@ fn main() { elog('fast_job PATH: ${os.getenv('PATH')}') os.chdir(fast_dir)! - elog('fast_job start in os.get_current_dir(): ${os.get_current_dir()}') + elog('fast_job start in os.getwd(): ${os.getwd()}') defer { elog('fast_job end') diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 9f4b946da1..b86aa65b55 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -370,7 +370,7 @@ pub fn (mut ts TestSession) add(file string) { pub fn (mut ts TestSession) test() { // Ensure that .tmp.c files generated from compiling _test.v files, // are easy to delete at the end, *without* affecting the existing ones. - current_wd := os.get_current_dir() + current_wd := os.getwd() if current_wd == os.wd_at_startup && current_wd == ts.vroot { ts.root_relative = true } diff --git a/cmd/tools/performance_compare.v b/cmd/tools/performance_compare.v index 5286dbe0cd..56304441c0 100644 --- a/cmd/tools/performance_compare.v +++ b/cmd/tools/performance_compare.v @@ -25,7 +25,7 @@ mut: fn new_context() Context { return Context{ - cwd: os.get_current_dir() + cwd: os.getwd() commit_after: 'master' warmups: 4 } diff --git a/cmd/tools/test_os_process.v b/cmd/tools/test_os_process.v index cd22e82037..3eecbc0a5b 100644 --- a/cmd/tools/test_os_process.v +++ b/cmd/tools/test_os_process.v @@ -78,7 +78,7 @@ fn main() { eprintln('> args: ${args} | context: ${ctx}') } if ctx.show_wd { - ctx.println('WORK_DIR=${os.get_current_dir()}') + ctx.println('WORK_DIR=${os.getwd()}') } if ctx.show_env { all := os.environ() diff --git a/cmd/tools/vast/vast.v b/cmd/tools/vast/vast.v index e977f224aa..d39bb087ba 100644 --- a/cmd/tools/vast/vast.v +++ b/cmd/tools/vast/vast.v @@ -87,9 +87,9 @@ fn get_abs_path(path string) string { if os.is_abs_path(path) { return path } else if path.starts_with('./') { - return os.join_path(os.get_current_dir(), path[2..]) + return os.join_path(os.getwd(), path[2..]) } else { - return os.join_path(os.get_current_dir(), path) + return os.join_path(os.getwd(), path) } } diff --git a/cmd/tools/vbug.v b/cmd/tools/vbug.v index 47b8a10034..b9a234219b 100644 --- a/cmd/tools/vbug.v +++ b/cmd/tools/vbug.v @@ -20,7 +20,7 @@ fn get_vdoctor_output(is_verbose bool) string { fn get_v_build_output(is_verbose bool, is_yes bool, file_path string) string { mut vexe := os.getenv('VEXE') // prepare a V compiler with -g to have better backtraces if possible - wd := os.get_current_dir() + wd := os.getwd() os.chdir(vroot) or {} verbose_flag := if is_verbose { '-v' } else { '' } vdbg_path := $if windows { '${vroot}/vdbg.exe' } $else { '${vroot}/vdbg' } diff --git a/cmd/tools/vcover/main.v b/cmd/tools/vcover/main.v index a5d336a412..5e8b9e29bd 100644 --- a/cmd/tools/vcover/main.v +++ b/cmd/tools/vcover/main.v @@ -149,7 +149,7 @@ fn normalize_path(path string) string { fn main() { mut ctx := Context{} - ctx.working_folder = normalize_path(os.real_path(os.get_current_dir())) + ctx.working_folder = normalize_path(os.real_path(os.getwd())) mut fp := flag.new_flag_parser(os.args#[1..]) fp.application('v cover') fp.version('0.0.2') diff --git a/cmd/tools/vcreate/vcreate.v b/cmd/tools/vcreate/vcreate.v index ab07ad7597..e8faca9277 100644 --- a/cmd/tools/vcreate/vcreate.v +++ b/cmd/tools/vcreate/vcreate.v @@ -131,7 +131,7 @@ fn init_project(cmd Command) ! { mut c := Create{ template: get_template(cmd) } - dir_name := check_name(os.file_name(os.get_current_dir())) + dir_name := check_name(os.file_name(os.getwd())) if !os.exists('v.mod') { mod_dir_has_hyphens := dir_name.contains('-') c.name = if mod_dir_has_hyphens { dir_name.replace('-', '_') } else { dir_name } diff --git a/cmd/tools/vdoctor.v b/cmd/tools/vdoctor.v index 9bb1286da2..2c91d3de13 100644 --- a/cmd/tools/vdoctor.v +++ b/cmd/tools/vdoctor.v @@ -99,13 +99,13 @@ fn (mut a App) collect_info() { a.line('OS', '${os_kind}, ${os_details}') a.line('Processor', arch_details.join(', ')) a.println('') - get_current_dir := os.get_current_dir() + getwd := os.getwd() vmodules := os.vmodules_dir() vtmp_dir := os.vtmp_dir() vexe := os.getenv('VEXE') vroot := os.dir(vexe) os.chdir(vroot) or {} - a.line('get_current_dir', get_current_dir) + a.line('getwd', getwd) a.line('vexe', vexe) a.line('vexe mtime', time.unix(os.file_last_mod_unix(vexe)).str()) a.println('') diff --git a/cmd/tools/vsymlink/vsymlink.v b/cmd/tools/vsymlink/vsymlink.v index 689d469384..1a27450aee 100644 --- a/cmd/tools/vsymlink/vsymlink.v +++ b/cmd/tools/vsymlink/vsymlink.v @@ -35,6 +35,6 @@ fn setup_symlink_github() { eprintln(' On windows, use `.\\v.exe symlink` instead.') exit(1) } - content += '\n${os.get_current_dir()}\n' + content += '\n${os.getwd()}\n' os.write_file(os.getenv('GITHUB_PATH'), content) or { panic('Failed to write to GITHUB_PATH.') } } diff --git a/vlib/os/filepath.v b/vlib/os/filepath.v index 6dababfb1f..0fafc2f031 100644 --- a/vlib/os/filepath.v +++ b/vlib/os/filepath.v @@ -31,7 +31,7 @@ pub fn is_abs_path(path string) bool { // with the given `path` (if the `path` is relative) // and returns the absolute path representation. pub fn abs_path(path string) string { - wd := get_current_dir() + wd := getwd() if path == '' { return wd } diff --git a/vlib/os/filepath_test.v b/vlib/os/filepath_test.v index 923f8f5040..1769739de8 100644 --- a/vlib/os/filepath_test.v +++ b/vlib/os/filepath_test.v @@ -111,7 +111,7 @@ fn test_norm_path() { } fn test_abs_path() { - wd := get_current_dir() + wd := getwd() wd_w_sep := wd + path_separator $if windows { assert abs_path('path/to/file.v') == '${wd_w_sep}path\\to\\file.v' @@ -147,7 +147,7 @@ fn test_abs_path() { } fn test_existing_path() { - wd := get_current_dir() + wd := getwd() $if windows { assert existing_path('') or { '' } == '' assert existing_path('..') or { '' } == '..' diff --git a/vlib/os/find_abs_path_of_executable_test.v b/vlib/os/find_abs_path_of_executable_test.v index dbae744864..641b57ae78 100644 --- a/vlib/os/find_abs_path_of_executable_test.v +++ b/vlib/os/find_abs_path_of_executable_test.v @@ -10,7 +10,7 @@ fn test_find_abs_path_of_executable() { } original_path := os.getenv('PATH') - original_wdir := os.get_current_dir() + original_wdir := os.getwd() defer { os.chdir(original_wdir) or {} } diff --git a/vlib/os/os.c.v b/vlib/os/os.c.v index 34d2ac607e..54075b2a9b 100644 --- a/vlib/os/os.c.v +++ b/vlib/os/os.c.v @@ -756,16 +756,8 @@ pub fn chdir(path string) ! { } // getwd returns the absolute path of the current directory. -// @[deprecated: 'use `get_current_dir()` instead'] -// TODO: uncomment the deprecation here, after 2024-11-27 -@[deprecated_after: '2024-12-24'] -pub fn getwd() string { - return get_current_dir() -} - -// get_current_dir returns the absolute path of the current directory. @[manualfree] -pub fn get_current_dir() string { +pub fn getwd() string { unsafe { buf := [max_path_buffer_size]u8{} $if windows { diff --git a/vlib/os/os.v b/vlib/os/os.v index 931915370b..e2cd8d11a5 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -7,7 +7,7 @@ import strings pub const max_path_len = 4096 -pub const wd_at_startup = get_current_dir() +pub const wd_at_startup = getwd() const f_ok = 0 diff --git a/vlib/os/os_js.js.v b/vlib/os/os_js.js.v index f6a05f3f7c..8fd042fc0c 100644 --- a/vlib/os/os_js.js.v +++ b/vlib/os/os_js.js.v @@ -152,10 +152,6 @@ pub fn read_file(s string) !string { } pub fn getwd() string { - return get_current_dir() -} - -pub fn get_current_dir() string { res := '' #res.str = $process.cwd() diff --git a/vlib/os/os_test.c.v b/vlib/os/os_test.c.v index ea496bdab6..f9009ade9f 100644 --- a/vlib/os/os_test.c.v +++ b/vlib/os/os_test.c.v @@ -445,7 +445,7 @@ fn test_realpath_removes_dots() { } fn test_realpath_absolutizes_existing_relative_paths() { - old_wd := os.get_current_dir() + old_wd := os.getwd() defer { os.chdir(old_wd) or { panic(err) } } diff --git a/vlib/os/process_test.v b/vlib/os/process_test.v index aacba18603..8459d301d5 100644 --- a/vlib/os/process_test.v +++ b/vlib/os/process_test.v @@ -36,7 +36,7 @@ fn test_getpid() { fn test_set_work_folder() { new_work_folder := os.real_path(os.temp_dir()) - parent_working_folder := os.get_current_dir() + parent_working_folder := os.getwd() dump(new_work_folder) dump(parent_working_folder) if new_work_folder == parent_working_folder { @@ -57,7 +57,7 @@ fn test_set_work_folder() { child_work_folder := output.find_between('stdout, WORK_DIR=', '\n').trim_space() dump(child_work_folder) assert child_work_folder == new_work_folder - new_parent_work_folder := os.get_current_dir() + new_parent_work_folder := os.getwd() dump(new_parent_work_folder) assert new_parent_work_folder == parent_working_folder assert new_parent_work_folder != child_work_folder diff --git a/vlib/v/builder/builder.v b/vlib/v/builder/builder.v index 7c585ee2ee..a897d40464 100644 --- a/vlib/v/builder/builder.v +++ b/vlib/v/builder/builder.v @@ -405,7 +405,7 @@ pub fn (b &Builder) find_module_path(mod string, fpath string) !string { module_lookup_paths << vmod_file_location.vmod_folder } module_lookup_paths << b.module_search_paths - module_lookup_paths << os.get_current_dir() + module_lookup_paths << os.getwd() // go up through parents looking for modules a folder. // we need a proper solution that works most of the time. look at vdoc.get_parent_mod if fpath.contains(os.path_separator + 'modules' + os.path_separator) { diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index db98fab239..093e9f691f 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -636,7 +636,7 @@ pub fn (mut v Builder) cc() { vdir := os.dir(vexe) mut tried_compilation_commands := []string{} mut tcc_output := os.Result{} - original_pwd := os.get_current_dir() + original_pwd := os.getwd() for { // try to compile with the chosen compiler // if compilation fails, retry again with another @@ -1109,7 +1109,7 @@ fn (mut v Builder) build_thirdparty_obj_file(mod string, path string, moduleflag println(rebuild_reason_message) } // prepare for tcc, it needs relative paths to thirdparty/tcc to work: - current_folder := os.get_current_dir() + current_folder := os.getwd() os.chdir(v.pref.vroot) or {} mut all_options := []string{} diff --git a/vlib/v/builder/compile.v b/vlib/v/builder/compile.v index b5641ef3e4..52bac1ebc8 100644 --- a/vlib/v/builder/compile.v +++ b/vlib/v/builder/compile.v @@ -28,7 +28,7 @@ fn check_if_output_folder_is_writable(pref_ &pref.Preferences) { // without a folder component, just use the current folder instead: mut output_folder := odir if odir.len == pref_.out_name.len { - output_folder = os.get_current_dir() + output_folder = os.getwd() } os.ensure_folder_is_writable(output_folder) or { // An early error here, is better than an unclear C error later: diff --git a/vlib/v/builder/rebuilding.v b/vlib/v/builder/rebuilding.v index 8e8d13dd8e..a94d384cf6 100644 --- a/vlib/v/builder/rebuilding.v +++ b/vlib/v/builder/rebuilding.v @@ -176,7 +176,7 @@ pub fn (mut b Builder) find_invalidated_modules_by_files(all_files []string) []s } fn (mut b Builder) v_build_module(vexe string, imp_path string) { - pwd := os.get_current_dir() + pwd := os.getwd() defer { os.chdir(pwd) or {} } diff --git a/vlib/v/checker/autocomplete.v b/vlib/v/checker/autocomplete.v index c8d0323db3..dad8d7055f 100644 --- a/vlib/v/checker/autocomplete.v +++ b/vlib/v/checker/autocomplete.v @@ -10,7 +10,7 @@ fn (mut c Checker) ident_autocomplete(node ast.Ident) { // Mini LS hack (v -line-info "a.v:16") println( 'checker.ident() info.line_nr=${c.pref.linfo.line_nr} node.line_nr=${node.pos.line_nr} ' + - ' pwd="${os.get_current_dir()}" file="${c.file.path}", ' + + ' pwd="${os.getwd()}" file="${c.file.path}", ' + ' pref.linfo.path="${c.pref.linfo.path}" node.name="${node.name}" expr="${c.pref.linfo.expr}"') // Make sure this ident is on the same line as requeste, in the same file, and has the same name same_line := node.pos.line_nr in [c.pref.linfo.line_nr - 1, c.pref.linfo.line_nr + 1, c.pref.linfo.line_nr] @@ -21,7 +21,7 @@ fn (mut c Checker) ident_autocomplete(node ast.Ident) { if !same_name { return } - abs_path := os.join_path(os.get_current_dir(), c.file.path) + abs_path := os.join_path(os.getwd(), c.file.path) if c.pref.linfo.path !in [c.file.path, abs_path] { return } diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index d5ea131307..50a6604e08 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -422,8 +422,7 @@ pub fn (mut c Checker) check_files(ast_files []&ast.File) { // After the main checker run, run the line info check, print line info, and exit (if it's present) if !c.pref.linfo.is_running && c.pref.line_info != '' { //'' && c.pref.linfo.line_nr == 0 { // c.do_line_info(c.pref.line_info, ast_files) - println('setting is_running=true, pref.path=${c.pref.linfo.path} curdir' + - os.get_current_dir()) + println('setting is_running=true, pref.path=${c.pref.linfo.path} curdir' + os.getwd()) c.pref.linfo.is_running = true for i, file in ast_files { // println(file.path) @@ -433,8 +432,7 @@ pub fn (mut c Checker) check_files(ast_files []&ast.File) { exit(0) } else if file.path.starts_with('./') { // Maybe it's a "./foo.v", linfo.path has an absolute path - abs_path := os.join_path(os.get_current_dir(), file.path).replace('/./', - '/') // TODO: join_path shouldn't have /./ + abs_path := os.join_path(os.getwd(), file.path).replace('/./', '/') // TODO: join_path shouldn't have /./ if abs_path == c.pref.linfo.path { c.check_files([ast_files[i]]) exit(0) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index e77cb35034..2b3122d333 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -202,7 +202,7 @@ fn (mut p Parser) free_scanner() { } } -const normalised_working_folder = (os.real_path(os.get_current_dir()) + os.path_separator).replace('\\', +const normalised_working_folder = (os.real_path(os.getwd()) + os.path_separator).replace('\\', '/') pub fn (mut p Parser) set_path(path string) { diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index cb5bc69494..749843bdef 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -891,7 +891,7 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin res.is_o = true } if !os.is_abs_path(res.out_name) { - res.out_name = os.join_path(os.get_current_dir(), res.out_name) + res.out_name = os.join_path(os.getwd(), res.out_name) } i++ } diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index 2e9bb9ab68..118c522242 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -119,7 +119,7 @@ pub fn new_scanner_file(file_path string, comments_mode CommentsMode, pref_ &pre mut raw_text := util.read_file(file_path) or { return err } if pref_.line_info != '' { // Add line info expr to the scanner text - abs_path := os.join_path(os.get_current_dir(), file_path) + abs_path := os.join_path(os.getwd(), file_path) if pref_.linfo.path in [file_path, abs_path] { raw_text = pref.add_line_info_expr_to_program_text(raw_text, pref_.linfo) } diff --git a/vlib/v/slow_tests/repl/runner/runner.v b/vlib/v/slow_tests/repl/runner/runner.v index 5f57f10284..c85e63d7c0 100644 --- a/vlib/v/slow_tests/repl/runner/runner.v +++ b/vlib/v/slow_tests/repl/runner/runner.v @@ -25,7 +25,7 @@ pub fn full_path_to_v(dirs_in int) string { args := os.args vreal := os.real_path('v') myself := os.real_path( os.executable() ) - wd := os.get_current_dir() + wd := os.getwd() println('args are: $args') println('vreal : $vreal') println('myself : $myself') @@ -90,13 +90,13 @@ pub fn run_prod_file(wd string, vexec string, file string) !string { pub fn new_options() RunnerOptions { vexec := full_path_to_v(5) - mut wd := os.get_current_dir() + mut wd := os.getwd() mut files := []string{} if os.args.len > 1 { files = os.args[1..].clone() } else { os.chdir(os.dir(vexec)) or {} - wd = os.get_current_dir() + wd = os.getwd() files = os.walk_ext('.', '.repl') } return RunnerOptions{ @@ -107,7 +107,7 @@ pub fn new_options() RunnerOptions { } pub fn new_prod_options() RunnerOptions { - wd := os.get_current_dir() + wd := os.getwd() vexec := full_path_to_v(4) mut files := []string{} if os.args.len > 1 { diff --git a/vlib/v/util/module.v b/vlib/v/util/module.v index 3a6695b0a2..31a68d61e2 100644 --- a/vlib/v/util/module.v +++ b/vlib/v/util/module.v @@ -64,8 +64,8 @@ pub fn qualify_module(pref_ &pref.Preferences, mod string, file_path string) str // TODO: 2022-01-30: That makes lookup dependent on fragile environment factors. // TODO: 2022-01-30: The lookup should be relative to the folder, in which the current file is, // TODO: 2022-01-30: *NOT* to the working folder of the compiler, which can change easily. - if clean_file_path.replace(os.get_current_dir() + os.path_separator, '') == mod { - trace_qualify(@FN, mod, file_path, 'module_res 2', mod, 'clean_file_path - get_current_dir == mod, clean_file_path: ${clean_file_path}') + if clean_file_path.replace(os.getwd() + os.path_separator, '') == mod { + trace_qualify(@FN, mod, file_path, 'module_res 2', mod, 'clean_file_path - getwd == mod, clean_file_path: ${clean_file_path}') return mod } if m1 := mod_path_to_full_name(pref_, mod, clean_file_path) { diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index e00155f0b8..39482aac9f 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -277,7 +277,7 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) { println('Compiling ${tool_name} with: "${compilation_command}"') } - current_work_dir := os.get_current_dir() + current_work_dir := os.getwd() tlog('recompiling ${tool_source}') lockfile := tool_exe + '.lock' tlog('lockfile: ${lockfile}') diff --git a/vlib/veb/static_handler.v b/vlib/veb/static_handler.v index 128ffb5dbe..6cbc59c6c6 100644 --- a/vlib/veb/static_handler.v +++ b/vlib/veb/static_handler.v @@ -56,7 +56,7 @@ pub fn (mut sh StaticHandler) handle_static(directory_path string, root bool) !b // ``` pub fn (mut sh StaticHandler) host_handle_static(host string, directory_path string, root bool) !bool { if !os.exists(directory_path) { - return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.get_current_dir()}') + return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.getwd()}') } dir_path := directory_path.trim_space().trim_right('/') mut mount_path := '' @@ -84,7 +84,7 @@ pub fn (mut sh StaticHandler) host_mount_static_folder_at(host string, directory if mount_path == '' || mount_path[0] != `/` { return error('invalid mount path! The path should start with `/`') } else if !os.exists(directory_path) { - return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.get_current_dir()}') + return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.getwd()}') } dir_path := directory_path.trim_right('/') diff --git a/vlib/x/vweb/static_handler.v b/vlib/x/vweb/static_handler.v index 902bdfbfa5..3921752c67 100644 --- a/vlib/x/vweb/static_handler.v +++ b/vlib/x/vweb/static_handler.v @@ -56,7 +56,7 @@ pub fn (mut sh StaticHandler) handle_static(directory_path string, root bool) !b // ``` pub fn (mut sh StaticHandler) host_handle_static(host string, directory_path string, root bool) !bool { if !os.exists(directory_path) { - return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.get_current_dir()}') + return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.getwd()}') } dir_path := directory_path.trim_space().trim_right('/') mut mount_path := '' @@ -84,7 +84,7 @@ pub fn (mut sh StaticHandler) host_mount_static_folder_at(host string, directory if mount_path == '' || mount_path[0] != `/` { return error('invalid mount path! The path should start with `/`') } else if !os.exists(directory_path) { - return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.get_current_dir()}') + return error('directory `${directory_path}` does not exist. The directory should be relative to the current working directory: ${os.getwd()}') } dir_path := directory_path.trim_right('/')