fix smartupdate execution

This commit is contained in:
Philipp Kunz 2017-08-16 23:46:20 +02:00
parent 7e8e4b1891
commit 70b83fcafc
2 changed files with 15 additions and 7 deletions

16
dist/npmts.cli.js vendored
View File

@ -1,4 +1,12 @@
"use strict"; "use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const q = require("smartq"); const q = require("smartq");
const plugins = require("./npmts.plugins"); const plugins = require("./npmts.plugins");
@ -20,11 +28,11 @@ const NpmtsShip = require("./npmts.ship");
*/ */
let npmtsAnalytics = new plugins.smartanalytics.AnalyticsAccount('npmts', 'UA-64087619-5'); let npmtsAnalytics = new plugins.smartanalytics.AnalyticsAccount('npmts', 'UA-64087619-5');
npmtsAnalytics.sendEvent('npm', 'exec', 'git.zone'); npmtsAnalytics.sendEvent('npm', 'exec', 'git.zone');
exports.run = () => { exports.run = () => __awaiter(this, void 0, void 0, function* () {
let done = q.defer(); let done = q.defer();
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot); let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
// check for updates // check for updates
plugins.smartupdate.standardHandler.check('npmts', npmtsProjectInfo.version); yield plugins.smartupdate.standardHandler.check('npmts', npmtsProjectInfo.version);
let npmtsCli = new plugins.smartcli.Smartcli(); let npmtsCli = new plugins.smartcli.Smartcli();
npmtsCli.standardTask() npmtsCli.standardTask()
.then((argvArg) => { .then((argvArg) => {
@ -70,5 +78,5 @@ exports.run = () => {
} }); } });
npmtsCli.addVersion(npmtsProjectInfo.version); npmtsCli.addVersion(npmtsProjectInfo.version);
npmtsCli.startParse(); npmtsCli.startParse();
return done.promise; return yield done.promise;
}; });

View File

@ -21,11 +21,11 @@ import * as NpmtsShip from './npmts.ship'
let npmtsAnalytics = new plugins.smartanalytics.AnalyticsAccount('npmts','UA-64087619-5') let npmtsAnalytics = new plugins.smartanalytics.AnalyticsAccount('npmts','UA-64087619-5')
npmtsAnalytics.sendEvent('npm','exec','git.zone') npmtsAnalytics.sendEvent('npm','exec','git.zone')
export let run = () => { export let run = async () => {
let done = q.defer() let done = q.defer()
let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot) let npmtsProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot)
// check for updates // check for updates
plugins.smartupdate.standardHandler.check('npmts', npmtsProjectInfo.version) await plugins.smartupdate.standardHandler.check('npmts', npmtsProjectInfo.version)
let npmtsCli = new plugins.smartcli.Smartcli() let npmtsCli = new plugins.smartcli.Smartcli()
npmtsCli.standardTask() npmtsCli.standardTask()
.then((argvArg) => { .then((argvArg) => {
@ -70,5 +70,5 @@ export let run = () => {
.catch((err) => { if (err instanceof Error) { console.log(err) } }) .catch((err) => { if (err instanceof Error) { console.log(err) } })
npmtsCli.addVersion(npmtsProjectInfo.version) npmtsCli.addVersion(npmtsProjectInfo.version)
npmtsCli.startParse() npmtsCli.startParse()
return done.promise return await done.promise
} }