Skip to content

Commit

Permalink
feat: add cli update support
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Aug 25, 2019
1 parent b784fa5 commit 2f2d340
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import Command from 'common-bin';
import fs from 'fs';
import env2 from 'env2';
import path from 'path';
import updateNotifier from 'update-notifier';

import CheckCommand from './command/check';
import GenerateCommand from './command/generate';
import SpeedCommand from './command/speed';
import UploadCommand from './command/upload';
import { normalizeConfig } from './utils';
import pkg from '../package.json';

const envPath = path.resolve(process.cwd(), './.env');

Expand All @@ -19,6 +20,7 @@ export class SurgioCommand extends Command {
env2(envPath);
}

updateNotifier({pkg}).notify();
this.usage = 'Usage: surgio <command> [options]';
this.load(path.join(__dirname, './command'));
this.yargs.alias('v', 'version');
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"shelljs": "^0.8.3",
"snyk": "^1.217.3",
"speedtest-net": "^1.5.1",
"update-notifier": "^3.0.1",
"urlsafe-base64": "^1.0.0",
"winston": "^3.2.1",
"yaml": "^1.5.1"
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"inlineSourceMap": true,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"allowSyntheticDefaultImports": true, // https://zhuanlan.zhihu.com/p/29022311
"resolveJsonModule": true,

// "strict": true /* Enable all strict type-checking options. */,

Expand Down

0 comments on commit 2f2d340

Please sign in to comment.