UNPKG

@vortex.so/cli

Version:

CLI to interact with Vortex.

55 lines (53 loc) 1.24 kB
class Operation { options; state = { name: "", org: "", namespace: "", handle: "", description: "", kind: void 0, type: void 0, release: void 0, oldVersionSource: "", oldVersion: "", oldBuild: void 0, newVersion: "", newBuild: void 0, commitMessage: "", tagName: "", updatedFiles: [], skippedFiles: [] }; get results() { const options = this.options; const state = this.state; return { name: state.name, namespace: state.namespace, org: state.org, handle: state.handle, description: state.description, release: state.release, oldVersion: state.oldVersion, newVersion: state.newVersion, oldBuild: state.oldBuild, newBuild: state.newBuild, commit: options.commit ? state.commitMessage : false, tag: options.tag ? state.tagName : false, updatedFiles: state.updatedFiles.slice(), skippedFiles: state.skippedFiles.slice() }; } constructor(options) { this.options = options; } static async start(options) { return new Operation(options); } update(newState) { Object.assign(this.state, newState); return this; } } export { Operation };