@google/clasp
Version:
Develop Apps Script Projects locally
17 lines (16 loc) • 737 B
JavaScript
import { Command } from 'commander';
import { intl } from '../intl.js';
export const command = new Command('logout').description('Logout of clasp').action(async function () {
var _a;
const auth = this.opts().auth;
if (!auth.credentialStore) {
const msg = intl.formatMessage({ id: "vWMhE2", defaultMessage: [{ type: 0, value: "No credential store found, unable to log out." }] });
this.error(msg);
}
if (!auth.credentials) {
return;
}
(_a = auth.credentialStore) === null || _a === void 0 ? void 0 : _a.delete(auth.user);
const successMessage = intl.formatMessage({ id: "lRlj4t", defaultMessage: [{ type: 0, value: "Deleted credentials." }] });
console.log(successMessage);
});