How to use the env-editor.allEditors function in env-editor

To help you get started, we’ve selected a few env-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cypress-io / cypress / packages / server / lib / util / editors.ts View on Github external
export const getUserEditors = (): Bluebird => {
  return Bluebird.filter(allEditors(), (editor) => {
    debug('check if user has editor %s with binary %s', editor.name, editor.binary)

    return shell.commandExists(editor.binary)
  })
  .then((editors: Editor[] = []) => {
    debug('user has the following editors: %o', editors)

    return savedState.create()
    .then((state) => {
      return state.get('preferredEditor')
    })
    .then((preferredEditor?: CyEditor) => {
      debug('saved preferred editor: %o', preferredEditor)

      return _.map(editors, createEditor).concat([getOtherEditor(preferredEditor)])
    })

env-editor

Get metadata on the default editor or a specific editor

MIT
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis