UNPKG

@google/clasp

Version:

Develop Apps Script Projects locally

20 lines (19 loc) 969 B
import { Command } from 'commander'; import { intl } from '../intl.js'; import { assertGcpProjectConfigured, maybePromptForProjectId, withSpinner } from './utils.js'; export const command = new Command('disable-api') .description('Disable a service for the current project.') .argument('<api>', 'Service to disable') .action(async function (serviceName) { const clasp = this.opts().clasp; await maybePromptForProjectId(clasp); assertGcpProjectConfigured(clasp); const spinnerMsg = intl.formatMessage({ id: "awbyYM", defaultMessage: [{ type: 0, value: "Disabling service..." }] }); await withSpinner(spinnerMsg, async () => { await clasp.services.disableService(serviceName); }); const successMessage = intl.formatMessage({ id: "tjmJ+e", defaultMessage: [{ type: 0, value: "Disabled " }, { type: 1, value: "name" }, { type: 0, value: " API." }] }, { name: serviceName, }); console.log(successMessage); });