Skip to content

Commit

Permalink
get editor from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kla committed Nov 24, 2024
1 parent 1026fc2 commit 5d2b922
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/commands/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>', 'Name of application')
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5d2b922

Please sign in to comment.