Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: works when ran through a symlink #850

Merged
merged 2 commits into from
Aug 25, 2024
Merged

fix: works when ran through a symlink #850

merged 2 commits into from
Aug 25, 2024

Conversation

EDM115
Copy link
Contributor

@EDM115 EDM115 commented Aug 25, 2024

closes #849

I'll let you bump the version and create the executables
Successfully tested on Windows :
image
image

I only tried the built windows executable, but this shouldn't affect builds for other distros.
Also my knowledge in Perl is really the bare minimum so there could be a better way to write it or maybe some imports are duplicated. All I know is that it works :)

@EDM115
Copy link
Contributor Author

EDM115 commented Aug 25, 2024

also I didn't modified Unix/cloc but tbh I don't really know how this repo works 😅

@AlDanial
Copy link
Owner

Impressive. Thanks for making the effort to figure this out. I have one minor request: please move the line with
my $exec_path = abs_path($0); inside the if test for $ON_WINDOWS.

- also edited the file in Unix dir as I believe they shouldn't be different
- edited Unix/AUTHORS
@EDM115
Copy link
Contributor Author

EDM115 commented Aug 25, 2024

done 👍

Tip

If anyone still have issues, here's the built artifact for 2.02 :
cloc_#850_2.02.zip
VirusTotal check : https://www.virustotal.com/gui/file/44dab7d5936d3661535d86ab8b5d9c8186a63409bc59bdd0d1bad898c9266041 (akin to existing scans)

Don't trust me ? Wanna build it yourself ?
git clone https://github.com/AlDanial/cloc.git && cd cloc
(Needs to have Perl installed, like Strawberry Perl on Windows)
cpan -i Digest::MD5 && cpan -i Regexp::Common && cpan -i Algorithm::Diff && cpan -i PAR::Packer && cpan -if Win32::LongPath (last one may fail to execute one test on latests SP versions)
pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc.exe cloc
Copy-paste the .exe into %LOCALAPPDATA%\Microsoft\WinGet\Packages\AlDanial.Cloc_Microsoft.Winget.Source_8wekyb3d8bbwe\

@AlDanial AlDanial merged commit 1f11b89 into AlDanial:master Aug 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] cloc won't work if ran through a symlink on Windows (ex Winget) : Can't locate PAR.pm in @INC
2 participants