0

Is it possible to run the default editor (which is set for git) using grunt-shell to open and edit an file (on ubuntu)?

In my attempt it is running sublime, but every local system is using a different editor...

grunt.initConfig({
  shell: {
    changelog: {
      options: {
        stdinRawMode: true
      },
      command: 'subl -w CHANGELOG.md'
    }
  }
})
user3142695
  • 15,844
  • 47
  • 176
  • 332

1 Answers1

1

Try:

command: '`git var GIT_EDITOR` CHANGELOG.md'

git var GIT_EDITOR get the configured editor — from the environment var, from local or global config, or fallback to other environment variables (VISUAL/EDITOR) or default vi.

phd
  • 82,685
  • 13
  • 120
  • 165