Atom-beautify: Use globally installed cljfmt package as beautifier executable

Created on 5 Jan 2017  路  9Comments  路  Source: Glavin001/atom-beautify

I installed cljmt with npm -g node-cljfmt here

C:\Users\rwobb\Desktop\clojure\paintings2>npm install -g node-cljfmt

C:\Users\rwobbAppData\Roaming\npmcljfmt -> C:\Users\rwobbAppData\Roaming\npmnode_modules\node-cljfmt\bincljfmt
[email protected] C:\Users\rwobbAppData\Roaming\npmnode_modules\node-cljfmt

but still in node I get this error message :

Could not find 'C:\Users\rwobb.atom\packages\atom-beautify\node_modules.bin\cljfmt'. The program may not be installed.

I noticed that a / is missing between rwobb and .atom

enhancement

Most helpful comment

@rwobben Because this is free and open software with a lot of complex pieces. Without the help of contributors this project would have collapsed under its own weight long ago as it is too much effort to do well for a single person. We need help to make this project great. Help us help you!

Please reference this issue as #1448 when you submit your pull request and please ask us if you need help.

All 9 comments

I wonder if this is an Atom defect.

And another \ missing between node_modules and .bin (node_modules.bin).

The applicable code is: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/cljfmt/index.coffee#L16

Please try uninstalling and reinstalling Atom-Beautify.

Then I see the same error message

@rwobben it looks like the current implementation does not use the globally installed cljfmt: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/cljfmt/index.coffee#L16
I would approve and merge a Pull Request removing the locally installed node-cljfmt and instead using the globally instead executable. In fact, it may be as simple as changing:

    # This appears not to work for you
    cljfmt = path.resolve(__dirname, "..", "..", "..", "node_modules/.bin/cljfmt")

to

    # This would fallback to using the executable found within your PATHs which is globally installed
    cljfmt = "cljfmt"

I recommend trying:

      @run("cljfmt", [
        @tempFile("input", text),
        "--edn=" + formatPath
      ]).then(=>
        @readFile(filePath)))

Let me know if that works for you! I look forward to your Pull Request resolution this issue 馃槂 .

Why do you think I can solve this . Im a beginner in clojure and not in java or whatever langage this is made.

@rwobben Because this is free and open software with a lot of complex pieces. Without the help of contributors this project would have collapsed under its own weight long ago as it is too much effort to do well for a single person. We need help to make this project great. Help us help you!

Please reference this issue as #1448 when you submit your pull request and please ask us if you need help.

I made a pull request with the fix for this. If there is something wrong with my submission or if you want me to change something please let me know, it's my first pull request so I don't know what the proper procedure is.

Thank you, @andyrusu and @prettydiff.

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

catscarlet picture catscarlet  路  3Comments

opikhidayat picture opikhidayat  路  4Comments

philippelesaux picture philippelesaux  路  4Comments

misterernest picture misterernest  路  3Comments

kuzyn picture kuzyn  路  3Comments