@@ -40,9 +40,13 @@ switch (eventType) {
|
||||
fs.writeFileSync(startTimestampFilePath, Date.now(), 'utf-8');
|
||||
break;
|
||||
case 'success':
|
||||
var startTime = fs.readFileSync(startTimestampFilePath, 'utf-8');
|
||||
analytics[actionCategory + 'Success'](actionName, Date.now() - startTime);
|
||||
fs.unlinkSync(startTimestampFilePath);
|
||||
try {
|
||||
var startTime = fs.readFileSync(startTimestampFilePath, 'utf-8');
|
||||
analytics[actionCategory + 'Success'](actionName, Date.now() - startTime);
|
||||
fs.unlinkSync(startTimestampFilePath);
|
||||
} catch(e) {
|
||||
console.log('No start timestamp file "' + startTimestampFilePath + '" found, skipping analytics.');
|
||||
}
|
||||
break;
|
||||
case 'error':
|
||||
var startTime = fs.readFileSync(startTimestampFilePath, 'utf-8');
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
var checkNpm = require('./check-node-modules.js');
|
||||
|
||||
var purgeIfStale = (process.argv.indexOf('--purge') !== -1)
|
||||
var purgeIfStale = (process.argv.indexOf('--purge') !== -1);
|
||||
|
||||
// check-node-modules will exit(1) if we don't need to install to short-circuit `npm install`
|
||||
// see .travis.yml's `install` block to see the reason for this
|
||||
process.exit(checkNpm(true, purgeIfStale) ? 1 : 0);
|
||||
|
||||
checkNpm(true, purgeIfStale);
|
||||
|
||||
@@ -4,7 +4,7 @@ var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var NPM_SHRINKWRAP_FILE = 'npm-shrinkwrap.json';
|
||||
var NPM_SHRINKWRAP_CACHED_FILE = 'node_modules/npm-shrinkwrap.cached.json';
|
||||
var NPM_SHRINKWRAP_CACHED_FILE = 'node_modules/.npm-shrinkwrap.cached.json';
|
||||
var FS_OPTS = {encoding: 'utf-8'};
|
||||
var PROJECT_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ var fse = require('fs-extra');
|
||||
var path = require('path');
|
||||
|
||||
var NPM_SHRINKWRAP_FILE = 'npm-shrinkwrap.json';
|
||||
var NPM_SHRINKWRAP_CACHED_FILE = 'node_modules/npm-shrinkwrap.cached.json';
|
||||
var NPM_SHRINKWRAP_CACHED_FILE = 'node_modules/.npm-shrinkwrap.cached.json';
|
||||
var PROJECT_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
process.chdir(PROJECT_ROOT);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {RuleFailure} from 'tslint/lib/lint';
|
||||
import {AbstractRule} from 'tslint/lib/rules';
|
||||
import {RuleWalker} from 'tslint/lib/language/walker';
|
||||
import * as ts from 'tslint/node_modules/typescript';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
export class Rule extends AbstractRule {
|
||||
public apply(sourceFile: ts.SourceFile): RuleFailure[] {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {RuleFailure} from 'tslint/lib/lint';
|
||||
import {AbstractRule} from 'tslint/lib/rules';
|
||||
import {RuleWalker} from 'tslint/lib/language/walker';
|
||||
import * as ts from 'tslint/node_modules/typescript';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
export class Rule extends AbstractRule {
|
||||
public static FAILURE_STRING = "missing type declaration";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {RuleFailure} from 'tslint/lib/lint';
|
||||
import {AbstractRule} from 'tslint/lib/rules';
|
||||
import {RuleWalker} from 'tslint/lib/language/walker';
|
||||
import * as ts from 'tslint/node_modules/typescript';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
export class Rule extends AbstractRule {
|
||||
public static FAILURE_STRING = "missing type declaration";
|
||||
|
||||
Reference in New Issue
Block a user