JSON File Format for Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dave_L
    Veteran
    • Dec 2007
    • 351

    JSON File Format for Linux

    There's a JSON additional File Format available for Windows, but not for Linux. I'd like to try to make one for Linux. The same jq tool that the Windows version uses as a helper is available for Linux. Is there any documentation for doing this, or should I simply use the other File Formats as examples?
  • Aaron
    Team Scooter
    • Oct 2007
    • 16007

    #2
    We don't have specific Linux documentation, but the same general steps apply to both Windows and Linux using an Input and Output argument on the command line. Our Windows example is here:
    http://www.scootersoftware.com/suppo...rnalconversion

    And using other Linux downloads with conversions would help as general command line examples.

    We'd certainly appreciate it if you got it up and running. Feel free to post it in the forums or email it to us at [email protected] and we'll get it up on the website.
    Aaron P Scooter Software

    Comment

    • Dave_L
      Veteran
      • Dec 2007
      • 351

      #3
      Thanks for the documentation link. An article named "Moved Text is Considered Important" is not where I would have thought to look.

      Some questions:

      1. In the File Formats General tab, are the command lines supposed to use absolute paths? I get an error "External program ... not found", although I know that the path is correct.

      2. What's the difference between "Quick compare command line" and "Compare view command line"? Should both have parameters %1 and %2?

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16007

        #4
        Hello,

        1. Did you chmod +x your script file? This is needed to allow it to be executed. You can use a full file path to the script in the Conversion definition.

        2. The command lines in the File Format, Conversion tab are %s and %t (source/input, and target/output). S is the file passed in, while T should be the output from your script that is formatted as plain text.
        Aaron P Scooter Software

        Comment

        • Garret
          Team Scooter
          • May 2014
          • 11

          #5
          Hello Dave,

          We are in the process of releasing Linux and OS X versions of the "JSON sorted" format, however, we have found a bug with the import/export feature for Linux and OS X that is preventing the release of the format. That being said, it is possible to manually setup the file format with the prepared package that will be temporarily available at the following link:

          http://www.scootersoftware.com/files...rted_Linux.zip

          Here are the steps to follow to use the JSON sorted format:

          1) Download the Zip archive and extract the contents
          2) Copy the "Helpers" directory to your settings directory (ex: `cp ./Helpers ~/.config/bcompare`)
          3) Copy the JSON sorted format settings from the BCFileFormat.xml file that was in the Zip to your existing formats file (this is located at "~/.config/bcompare/BCFileFormats.xml") -- just to be safe, make a backup of the formats file that is in your settings directory. The key section you need for the JSON format will be the all of the XML between, and including, the nodes <TTextFormat Value="JSON Sorted"> and </TTextFormat>
          Garret H

          Scooter Software

          Comment

          • Dave_L
            Veteran
            • Dec 2007
            • 351

            #6
            Thanks for the replies. I'll try the "JSON sorted" format that you've provided.

            Comment

            • Dave_L
              Veteran
              • Dec 2007
              • 351

              #7
              Originally posted by Garret
              Hello Dave,

              We are in the process of releasing Linux and OS X versions of the "JSON sorted" format, however, we have found a bug with the import/export feature for Linux and OS X that is preventing the release of the format. ...
              I noticed that the "JSON sorted" format is now available on the Linux download page. I assume the bug is still present, since no new version of BC4 has been released.

              Can you describe the bug? Will it mess up my BC4 configuration if I attempt to import the format in the normal way?

              Comment

              • Dave_L
                Veteran
                • Dec 2007
                • 351

                #8
                I tried installing the JSON format manually using the above instructions. (I used the version on your download page (JSON sorted 13-Oct-2015), which had some differences from the .zip linked above.)

                It works properly, but I had to chmod the three files in the Helpers directory to be executable (755). Prior to that, I got misleading error messages ("External program ... not found" or "Conversion Error").

                You may want to add that to the instructions. Or maybe for Linux file formats you could use a tarball (.tar.gz) instead of a .zip, which would allow the files to be given execute permission within the archive.
                Last edited by Dave_L; 21-Oct-2015, 01:06 AM.

                Comment

                • Aaron
                  Team Scooter
                  • Oct 2007
                  • 16007

                  #9
                  Thanks for that feedback, we'll look into this. There is a crash that can occur where the Helpers or format are not imported, hence the manual steps that are needed to actually get the Helpers and xml inserted.
                  Aaron P Scooter Software

                  Comment

                  • Dave_L
                    Veteran
                    • Dec 2007
                    • 351

                    #10
                    Originally posted by Dave_L
                    ...
                    It works properly, but I had to chmod the three files in the Helpers directory to be executable (755). Prior to that, I got misleading error messages ("External program ... not found" or "Conversion Error")
                    ....
                    Under the same conditions, the command shell issues the error "Permission denied". That's a more useful message.

                    Comment

                    Working...