File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,5 @@ https://github.com/Inventitech
31
31
https://github.com/zhangzqs
32
32
https://github.com/drkameleon
33
33
https://github.com/jackos
34
- https://github.com/Aerek-Yasa
34
+ https://github.com/Aerek-Yasa
35
+ https://github.com/EDM115
Original file line number Diff line number Diff line change @@ -111,6 +111,19 @@ if ($ON_WINDOWS and $ENV{'SHELL'}) {
111
111
}
112
112
}
113
113
114
+ use Cwd "abs_path";
115
+ use File::Spec;
116
+ # Fix for issues when runing cloc through a symlink on Windows
117
+ # e.g. : it have been installed with Winget
118
+ # See https://github.com/AlDanial/cloc/issues/849
119
+ if ($ON_WINDOWS) {
120
+ my $exec_path = abs_path($0);
121
+ if (-l $0) {
122
+ $exec_path = abs_path(readlink($0));
123
+ }
124
+ $0 = $exec_path;
125
+ }
126
+
114
127
my $HAVE_Win32_Long_Path = 0;
115
128
# Win32::LongPath is an optional dependency that when available on
116
129
# Windows will be used to support reading files past the 255 char
Original file line number Diff line number Diff line change @@ -136,6 +136,19 @@ if ($ON_WINDOWS and $ENV{'SHELL'}) {
136
136
}
137
137
}
138
138
139
+ use Cwd "abs_path";
140
+ use File::Spec;
141
+ # Fix for issues when runing cloc through a symlink on Windows
142
+ # e.g. : it have been installed with Winget
143
+ # See https://github.com/AlDanial/cloc/issues/849
144
+ if ($ON_WINDOWS) {
145
+ my $exec_path = abs_path($0);
146
+ if (-l $0) {
147
+ $exec_path = abs_path(readlink($0));
148
+ }
149
+ $0 = $exec_path;
150
+ }
151
+
139
152
my $HAVE_Win32_Long_Path = 0;
140
153
# Win32::LongPath is an optional dependency that when available on
141
154
# Windows will be used to support reading files past the 255 char
You can’t perform that action at this time.
0 commit comments