From f534edc37115ecf5242b8ba6af978f63258f4e98 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 1 Oct 2020 01:30:22 +0200 Subject: [PATCH] doc: replace os.base_dir with os.dir --- cmd/tools/vdoc.v | 8 ++++---- vlib/log/log.v | 2 +- vlib/v/doc/doc.v | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/tools/vdoc.v b/cmd/tools/vdoc.v index 696803565f..0087bb49b3 100644 --- a/cmd/tools/vdoc.v +++ b/cmd/tools/vdoc.v @@ -38,7 +38,7 @@ const ( exe_path = os.executable() exe_dir = os.dir(exe_path) res_path = os.join_path(exe_dir, 'vdoc-resources') - vexe_path = os.base_dir(@VEXE) + vexe_path = os.dir(@VEXE) html_content = ' @@ -440,7 +440,7 @@ fn write_toc(cn doc.DocNode, nodes []doc.DocNode, mut toc strings.Builder) { } fn (cfg DocConfig) write_content(cn &doc.DocNode, dcs &doc.Doc, mut hw strings.Builder) { - base_dir := os.base_dir(os.real_path(cfg.input_path)) + base_dir := os.dir(os.real_path(cfg.input_path)) file_path_name := if cfg.is_multi { cn.file_path.replace('$base_dir/', '') } else { os.file_name(cn.file_path) } src_link := get_src_link(cfg.manifest.repo_url, file_path_name, cn.pos.line) children := dcs.contents.find_children_of(cn.name) @@ -702,7 +702,7 @@ fn (mut cfg DocConfig) generate_docs_from_file() { } else if os.is_dir(cfg.input_path) { cfg.input_path } else { - os.base_dir(cfg.input_path) + os.dir(cfg.input_path) } manifest_path := os.join_path(dir_path, 'v.mod') if os.exists(manifest_path) { @@ -877,7 +877,7 @@ fn get_ignore_paths(path string) ?[]string { fn lookup_module(mod string) ?string { mod_path := mod.replace('.', os.path_separator) - compile_dir := os.real_path(os.base_dir('.')) + compile_dir := os.real_path(os.dir('.')) modules_dir := os.join_path(compile_dir, 'modules', mod_path) vlib_path := os.join_path(vexe_path, 'vlib', mod_path) vmodules_path := os.join_path(os.home_dir(), '.vmodules', mod_path) diff --git a/vlib/log/log.v b/vlib/log/log.v index 8b9ea7c602..d6518ef438 100644 --- a/vlib/log/log.v +++ b/vlib/log/log.v @@ -51,7 +51,7 @@ pub fn (mut l Log) set_output_level(level Level) { pub fn (mut l Log) set_full_logpath(full_log_path string) { rlog_file := os.real_path(full_log_path) l.set_output_label(os.file_name(rlog_file)) - l.set_output_path(os.base_dir(rlog_file)) + l.set_output_path(os.dir(rlog_file)) } pub fn (mut l Log) set_output_label(label string) { diff --git a/vlib/v/doc/doc.v b/vlib/v/doc/doc.v index 796f3e6449..67a7ceccab 100644 --- a/vlib/v/doc/doc.v +++ b/vlib/v/doc/doc.v @@ -257,7 +257,7 @@ fn get_parent_mod(dir string) ?string { return error('root folder reached') } } - base_dir := os.base_dir(dir) + base_dir := os.dir(dir) fname_base_dir := os.file_name(base_dir) prefs := new_vdoc_preferences() fentries := os.ls(base_dir) or { @@ -420,7 +420,7 @@ fn (mut d Doc) expr_typ_to_string(ex ast.Expr) string { fn (mut d Doc) generate() ?Doc { // get all files - base_path := if os.is_dir(d.input_path) { d.input_path } else { os.real_path(os.base_dir(d.input_path)) } + base_path := if os.is_dir(d.input_path) { d.input_path } else { os.real_path(os.dir(d.input_path)) } d.is_vlib = 'vlib' !in base_path project_files := os.ls(base_path) or { return error_with_code(err, 0)