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

Uncrustify command not found #91

Closed
thedadams opened this issue Sep 14, 2014 · 7 comments
Closed

Uncrustify command not found #91

thedadams opened this issue Sep 14, 2014 · 7 comments
Assignees

Comments

@thedadams
Copy link
Contributor

Hello,

Beautify for Atom seems to be looking for uncrustify in the wrong place (at least for me). I installed uncrustify with HomeBrew, and it installed it in /usr/local/bin/. However, Beautify is looking in /bin/sh. Is it possible to add an uncrustify path option?

Thanks.

@Glavin001 Glavin001 self-assigned this Sep 14, 2014
@Glavin001
Copy link
Owner

Absolutely possible. Here is the Beautify handler for Uncrustify: https://github.com/Glavin001/atom-beautify/blob/master/lib/langs/uncrustify/index.coffee#L11
Feel free to submit a Pull Request or I will look into this later when I have some spare time.

@thedadams
Copy link
Contributor Author

I have some code that fixes this. I will submit a pull request soon.

@Glavin001
Copy link
Owner

Configuration options are now available for specifying custom uncrustifyPaths for each of the languages that are beautified with Uncrustify. See

# C
c_uncrustifyPath: ""
c_configPath: ""
# C++
cpp_uncrustifyPath: ""
cpp_configPath: ""
# Objective-C
objectivec_uncrustifyPath: ""
objectivec_configPath: ""
# C#
cs_uncrustifyPath: ""
cs_configPath: ""
# D
d_uncrustifyPath: ""
d_configPath: ""
# Java
java_uncrustifyPath: ""
java_configPath: ""
# Pawn
pawn_uncrustifyPath: ""
pawn_configPath: ""
# VALA
vala_uncrustifyPath: ""
for source code and list of all options.

Unfortunately, given how Atom Beautify scopes configuration options within languages, a global uncrustifyPath was not ideal to meet the requirements of Atom Beautify (configuration option supported in Atom Package Settings and in configuration files). So, for now, use the language specific uncrustifyPath. For instance, for java it will be java_uncrustifyPath, for C++ cpp_uncrustifyPath, etc.

Please let me know if there are any further questions.

@Glavin001
Copy link
Owner

Published to v0.11.0

@NathanHazout
Copy link

Can someone clarify all this for laymen like myself?

I get this error and I believe it's related to this issue:
Command failed: /bin/sh -c [ -f ~/.bash_profile ] && source ~/.bash_profile;[ -f ~/.bashrc ] && source ~/.bashrc;uncrustify -c "/tmp/114912-1834-1rcafl1.cfg" -f "/tmp/input114912-1834-1yunwl4" -o "/tmp/114912-1834-1lkb5ox" -l "JAVA" /bin/sh: 1: source: not found /bin/sh: 1: uncrustify: not found

I don't know what uncrusify is or if I'm supposed to do something, or if it's a bug on your end.

Running Atom 0.134 and Beautify 0.13.4 on Ubuntu 12.04 LTS.

@Glavin001
Copy link
Owner

Uncrustify is what handles beautification for some of the supported languages.
You can download it at http://sourceforge.net/projects/uncrustify/ and after installation should be good to go.

@RocketSumit
Copy link

I just installed uncrustify using home-brew in/usr/local/Cellar/uncrustify/0.63: and it worked for me in mac. Use brew install Uncrustify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants