| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import {Operation} from './Operation'; |
| 9 | |
| 10 | export class GhStackSubmitOperation extends Operation { |
| 11 | static opName = 'ghstack submit'; |
| 12 | |
| 13 | constructor(private options?: {draft?: boolean; updateMessage?: string}) { |
| 14 | super('GhStackSubmitOperation'); |
| 15 | } |
| 16 | |
| 17 | getArgs() { |
| 18 | const args = ['ghstack', 'submit']; |
| 19 | if (this.options?.draft) { |
| 20 | args.push('--draft'); |
| 21 | } |
| 22 | if (this.options?.updateMessage) { |
| 23 | args.push('--message', this.options?.updateMessage); |
| 24 | } |
| 25 | return args; |
| 26 | } |
| 27 | } |
| 28 | |