mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: print relative file paths for files in the current directory
This commit is contained in:
parent
c24d94f87f
commit
5977fc0644
@ -133,6 +133,10 @@ fn (s &Scanner) error_with_col(msg string, col int) {
|
||||
|
||||
fn (s &Scanner) get_error_filepath() string {
|
||||
if s.should_print_relative_paths_on_error {
|
||||
workdir := os.getwd() + os.path_separator
|
||||
if s.file_path.starts_with(workdir) {
|
||||
return s.file_path.replace( workdir, '')
|
||||
}
|
||||
return s.file_path
|
||||
}
|
||||
return os.realpath( s.file_path )
|
||||
|
Loading…
Reference in New Issue
Block a user