| 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 type {SettableConfigName} from '../types'; |
| 9 | |
| 10 | import {Operation} from './Operation'; |
| 11 | |
| 12 | export class SetConfigOperation extends Operation { |
| 13 | constructor( |
| 14 | private scope: 'user' | 'local' | 'global', |
| 15 | private configName: SettableConfigName, |
| 16 | private value: string, |
| 17 | ) { |
| 18 | super('SetConfigOperation'); |
| 19 | } |
| 20 | |
| 21 | static opName = 'SetConfig'; |
| 22 | |
| 23 | getArgs() { |
| 24 | return ['config', `--${this.scope}`, this.configName, this.value]; |
| 25 | } |
| 26 | } |
| 27 | |