@google/dscc-gen
Version:
Create component & connector projects with sane defaults.
48 lines • 1.6 kB
JavaScript
;
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const analytics = require("./analytics");
const analytics_1 = require("./analytics");
const main_1 = require("./main");
const util = require("./util");
(async () => {
await analytics.checkForOptOut();
analytics.trackEvent(analytics_1.Category.EXECUTION, analytics_1.Action.START);
let result;
try {
result = await main_1.main(path.join(__dirname, '..'));
}
catch (e) {
analytics.trackEvent(analytics_1.Category.EXECUTION, analytics_1.Action.ERROR_STOP);
if (e.failed) {
console.log(e.stderr);
}
else {
console.log(e.message);
}
return 1;
}
analytics.trackEvent(analytics_1.Category.EXECUTION, analytics_1.Action.STOP);
return result;
})().then(async (code) => {
await util.pause(200);
process.exit(code);
});
//# sourceMappingURL=index.js.map