diff --git a/src/commands/edit.ts b/src/commands/edit.ts index 5bd27e0..8f9dc37 100644 --- a/src/commands/edit.ts +++ b/src/commands/edit.ts @@ -2,9 +2,10 @@ import { exit } from "~/utils" import { Command } from 'commander' import { run } from "~/shell" import Stax from '~/stax' +import settings from '~/settings' export default function registerEditCommand(program: Command, stax: Stax) { - const editor = process.env.STAX_EDITOR || 'code' + const editor = settings.read('editor', process.env.STAX_EDITOR || 'code') // support STAX_EDITOR for backwards compatibility program.command('edit') .argument('', 'Name of application') diff --git a/src/settings.ts b/src/settings.ts index ab496da..c6c76f6 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -3,7 +3,7 @@ import { exit, verifyDirectory, resolve } from './utils' import yaml from 'js-yaml' import * as path from 'path' -const VALID_NAMES = [ 'services_home' ] +const VALID_NAMES = [ 'aliases','services_home', 'editor' ] function filename(): string { return path.join(process.env.STAX_HOME, 'settings.yaml')