1 | import { spawn } from 'p-spawn';
|
2 |
|
3 | // --------- Public get/set current project --------- //
|
4 | export async function getCurrentProject() {
|
5 | const p = await spawn('gcloud', ['config', 'list', '--format', 'value(core.project)'], { capture: 'stdout' });
|
6 | return p.stdout.toString().trim();
|
7 | }
|
8 |
|
9 | export async function setCurrentProject(name: string) {
|
10 | // gcloud config set project my-project
|
11 | await spawn('gcloud', ['config', 'set', 'project', name]);
|
12 | }
|
13 | // --------- /Public get/set current project --------- // |
\ | No newline at end of file |