Skip to content

Commit

Permalink
use default export
Browse files Browse the repository at this point in the history
  • Loading branch information
kla committed Nov 24, 2024
1 parent 5505a49 commit 956ac29
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/commands/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { pp } from '~/utils'
import settings from '~/settings'
import Stax from '~/stax'

export function registerAliasCommand(program: Command, stax: Stax) {
export default function registerAliasCommand(program: Command, stax: Stax) {
program.command('alias')
.argument('[name]', 'Name of application')
.argument('[alias]', 'Name of alias for application')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/cat.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerCatCommand(program: Command, stax: Stax) {
export default function registerCatCommand(program: Command, stax: Stax) {
program.command('cat')
.argument('<name>', 'Name of application')
.argument('<file>', 'Path to a file in the container')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Command } from 'commander'
import { pp } from '~/utils'
import Stax from '~/stax'

export function registerConfigCommand(program: Command, stax: Stax) {
export default function registerConfigCommand(program: Command, stax: Stax) {
program.command('config')
.argument('<name>', 'Name of application')
.option('-s, --service <name>', 'Name of service to act on')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/copy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerCopyCommand(program: Command, stax: Stax) {
export default function registerCopyCommand(program: Command, stax: Stax) {
program.command('copy')
.alias('cp')
.argument('<name>', 'Name of application')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/down.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerDownCommand(program: Command, stax: Stax) {
export default function registerDownCommand(program: Command, stax: Stax) {
program.command('down')
.argument('<name>', 'Name of application')
.option('-s, --service <name>', 'Name of service to act on')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/duplicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Command } from 'commander'
import { StaxConfig } from '~/types'
import Stax from '~/stax'

export function registerDuplicateCommand(program: Command, stax: Stax, overrides: StaxConfig) {
export default function registerDuplicateCommand(program: Command, stax: Stax, overrides: StaxConfig) {
program.command('duplicate')
.argument('<name>', 'Name of application')
.argument('<new-name>', 'Name of new application')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Command } from 'commander'
import { run } from "~/shell"
import Stax from '~/stax'

export function registerEditCommand(program: Command, stax: Stax) {
export default function registerEditCommand(program: Command, stax: Stax) {
const editor = process.env.STAX_EDITOR || 'code'

program.command('edit')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/exec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerExecCommand(program: Command, stax: Stax) {
export default function registerExecCommand(program: Command, stax: Stax) {
program.command('exec')
.alias('run')
.argument('<name>', 'Name of application')
Expand Down
8 changes: 5 additions & 3 deletions src/commands/get.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerGetCommand(program: Command, stax: Stax) {
export default function registerGetCommand(program: Command, stax: Stax) {
program.command('get')
.argument('<name>', 'Name of application')
.argument('<source>', 'File to copy from the container')
.argument('<destination>', 'Local destination to copy the file to')
.option('-s, --service <name>', 'Name of service to act on')
.description('Copy a from the container')
.action(async (name, source, destination, options) => stax.findContainer(name, options).get(source, destination))
.description('Copy a file from the container')
.action(async (name, source, destination, options) => {
await stax.findContainer(name, options).get(source, destination)
})
}
38 changes: 19 additions & 19 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { Command } from 'commander'
import { registerAliasCommand } from './alias'
import { registerCatCommand } from './cat'
import { registerLsCommand } from './ls'
import { registerConfigCommand } from './config'
import { registerCopyCommand } from './copy'
import { registerDownCommand } from './down'
import { registerDuplicateCommand } from './duplicate'
import { registerEditCommand } from './edit'
import { registerExecCommand } from './exec'
import { registerGetCommand } from './get'
import { registerInspectCommand } from './inspect'
import { registerLogsCommand } from './logs'
import { registerRebuildCommand } from './rebuild'
import { registerRemoveCommand } from './remove'
import { registerRestartCommand } from './restart'
import { registerSettingsCommand } from './settings'
import { registerSetupCommand } from './setup'
import { registerShellCommand } from './shell'
import { registerUpCommand } from './up'
import { StaxConfig } from '~/types'
import registerAliasCommand from './alias'
import registerCatCommand from './cat'
import registerLsCommand from './ls'
import registerConfigCommand from './config'
import registerCopyCommand from './copy'
import registerDownCommand from './down'
import registerDuplicateCommand from './duplicate'
import registerEditCommand from './edit'
import registerExecCommand from './exec'
import registerGetCommand from './get'
import registerInspectCommand from './inspect'
import registerLogsCommand from './logs'
import registerRebuildCommand from './rebuild'
import registerRemoveCommand from './remove'
import registerRestartCommand from './restart'
import registerSettingsCommand from './settings'
import registerSetupCommand from './setup'
import registerShellCommand from './shell'
import registerUpCommand from './up'
import Stax from '~/stax'

const DEFAULT_CONTEXT_NAME = 'stax'
Expand Down
2 changes: 1 addition & 1 deletion src/commands/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { capture } from '~/shell'
import { pp } from '~/utils'
import Stax from '~/stax'

export function registerInspectCommand(program: Command, stax: Stax) {
export default function registerInspectCommand(program: Command, stax: Stax) {
program.command('inspect')
.argument('<name>', 'Name of application')
.option('-c, --compose', 'Show the compose file')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/logs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerLogsCommand(program: Command, stax: Stax) {
export default function registerLogsCommand(program: Command, stax: Stax) {
program.command('logs')
.argument('<name>', 'Name of application')
.option('-s, --service <name>', 'Name of service to act on')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ls.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerLsCommand(program: Command, stax: Stax) {
export default function registerLsCommand(program: Command, stax: Stax) {
program.command('ls')
.alias('ps').alias('list')
.description('List applications')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Command } from 'commander'
import { StaxConfig } from '~/types'
import Stax from '~/stax'

export function registerRebuildCommand(program: Command, stax: Stax, overrides: StaxConfig) {
export default function registerRebuildCommand(program: Command, stax: Stax, overrides: StaxConfig) {
program.command('rebuild')
.argument('<name>', 'Name of application')
.option('-i, --inspect', 'Show the compose file')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/remove.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerRemoveCommand(program: Command, stax: Stax) {
export default function registerRemoveCommand(program: Command, stax: Stax) {
program.command('remove')
.alias('rm')
.argument('<name>', 'Name of application')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/restart.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerRestartCommand(program: Command, stax: Stax) {
export default function registerRestartCommand(program: Command, stax: Stax) {
program.command('restart')
.argument('<name>')
.description('Restart an application')
Expand Down
3 changes: 2 additions & 1 deletion src/commands/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Command } from 'commander'
import icons from '~/icons'
import settings from '~/settings'

export function registerSettingsCommand(program: Command) {
export default function registerSettingsCommand(program: Command) {
program.command('settings')
.argument('<name>', 'Name of setting')
.argument('[value]', 'Value of setting')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import setupWizard from '~/setup_wizard'
import Stax from '~/stax'
import settings from '~/settings'

export function registerSetupCommand(program: Command, stax: Stax, overrides: StaxConfig) {
export default function registerSetupCommand(program: Command, stax: Stax, overrides: StaxConfig) {
program.command('setup')
.argument('[location]', 'Path to a local directory or git repo of application')
.option('-s, --staxfile <staxfile>', 'Staxfile to use for setup')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/shell.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerShellCommand(program: Command, stax: Stax) {
export default function registerShellCommand(program: Command, stax: Stax) {
program.command('shell')
.alias('sh')
.argument('<name>', 'Name of application')
Expand Down
2 changes: 1 addition & 1 deletion src/commands/up.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Command } from 'commander'
import Stax from '~/stax'

export function registerUpCommand(program: Command, stax: Stax) {
export default function registerUpCommand(program: Command, stax: Stax) {
program.command('up')
.argument('<name>', 'Name of application')
.option('-s, --service <name>', 'Name of service to act on')
Expand Down

0 comments on commit 956ac29

Please sign in to comment.