UNPKG

@swell/cli

Version:

Swell's command line interface/utility

31 lines (29 loc) 1.02 kB
import { Flags } from '@oclif/core'; import { PushAppCommand } from '../../push-app-command.js'; export default class AppWatch extends PushAppCommand { static description = `Watches configuration files including functions, and automatically pushes to the remote store. Optionally synchronize all configs on change.`; static examples = [ 'swell app watch', 'swell app watch -a', 'swell app watch --sync-all', ]; static flags = { 'sync-all': Flags.boolean({ char: 'a', default: false, description: 'synchronize all app configurations on file change', }), }; static orientation = { env: 'test', }; static summary = 'Watch for changes and push app configurations.'; async run() { const { flags } = await this.parse(AppWatch); this.app = await this.getAppWithConfig(); this.log('Watching for changes...'); await this.watchForChanges({ syncAll: flags['sync-all'] }); } }