Skip to content

syntax_highlight_cli doesn't work via brew #249

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

Open
maxx27 opened this issue Jun 21, 2023 · 2 comments · May be fixed by #274
Open

syntax_highlight_cli doesn't work via brew #249

maxx27 opened this issue Jun 21, 2023 · 2 comments · May be fixed by #274

Comments

@maxx27
Copy link

maxx27 commented Jun 21, 2023

When I installed syntax-highlight via brew, it creates symlink:

$ ls -l /opt/homebrew/bin/syntax_highlight_cli
lrwxr-xr-x@ 1 maxim  admin  74 May 22 16:01 /opt/homebrew/bin/syntax_highlight_cli ->
  /Applications/Syntax Highlight.app/Contents/Resources/syntax_highlight_cli

When I want to convert any file:

$ mkdir ~/Temp
$ cd ~/Temp
$ echo Hello > test.txt
$ syntax_highlight_cli -o test.html test.txt
Error processing /Users/m.suslov/Temp/test.txt: Syntax Highlight: colorize.sh failed with exit code 127. Command was ('/Users/Contents/Resources/highlight/colorize.sh' '/Users/m.suslov/Temp/test.txt').


command: '/Users/Contents/Resources/highlight/colorize.sh' '/Users/m.suslov/Temp/test.txt'
exitCode: 127

Here we can see that colorize.sh is invoked with incorrect path

The same if I invoke with full path to brew symlink:

/opt/homebrew/bin/syntax_highlight_cli -o test.html test.txt

But when I invoke with fullpath to application, it works:

$ '/Applications/Syntax Highlight.app/Contents/Resources/syntax_highlight_cli' -o test.html test.txt

Could please fix calling colorize.sh with right path?

P.S. Version of syntax-highlight 2.1.19

@nborelli
Copy link

As a temporary fix for this problem, you can issue the following command to change the symlink to the correct path:

ln -sf "/Applications/Syntax Highlight.app/Contents/Resources/syntax_highlight_cli" "/opt/homebrew/bin/syntax_highlight_cli"

@dnicolson dnicolson linked a pull request May 5, 2024 that will close this issue
@W-quan
Copy link

W-quan commented Jun 29, 2024

Me too. And i had try install not by brew, still not work.

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 a pull request may close this issue.

3 participants