UNPKG

502 BPlain TextView Raw
1import { spawn } from 'p-spawn';
2
3// --------- Public get/set current project --------- //
4export 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
9export 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