skywind3000 / atom-shell-commands

Execute user defined shell commands (looking for new maintainers)
MIT License
37 stars 12 forks source link

Could not use more than one command for atom-shell-commands in config.cson #24

Open bhishanpdl opened 7 years ago

bhishanpdl commented 7 years ago

I am using Atom 1.19.2 in MacOS Sierra. When I try to save the config.cson file with additional commands it only saves the last command.

Example:

"*":
  "advanced-open-file":
    createDirectories: true
    createFileInstantly: true
    fuzzyMatch: true
  "atom-shell-commands":
    commands: [
      {
        name: "run_script"
        command: "bash"
        arguments: [
          "run_script.sh"
          "{FileName}"
        ]
        options:
          cwd: "{FileDir}"
          keymap: "ctrl-5"
      }
    ]
    # Another example
    commands: [
      {
        name: "copy"
        command: "cp"
        arguments: [
          "{FileName}"
          "/Users/poudel/Dropbox/FileBackups/macpro_{FileNameNoExt}{FileExt}"
        ]
        options:
          cwd: "{FileDir}"
          keymap: "ctrl-2"
      }
    ]
  # Another Example
    commands: [
      {
        name: "man"
        command: "/usr/bin/man"
        arguments: [
          "{CurWord}"
        ]
        options:
          cwd: "{FileDir}"
          keymap: "ctrl-1"
      }
    ]

Gives only the last command for man.

I have also posted a StackOverflow question for this, but could not get the answer. The quesition How can we fix the problem. Help will be greatly appreciated. atom-shell-commands is indeed one of the best packages, and I am waiting to use it.

skywind3000 commented 7 years ago

take this:

commands: [
    {
        name: "cmd1",
        ....
    },
    {
        name: "cmd2",
        ....
    },
    {
        name: "cmd3",
        ....
    }
]