This repository was archived by the owner on Apr 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,7 @@ export function npmVersionThreeOrLater(): Promise<CR.SetupWarning> {
88 reject ( {
99 key : 'updateNpm' ,
1010 title : 'Please update to NPM version 3+' ,
11- click : null ,
1211 text : 'Open a terminal and run:\n `npm install npm -g`' ,
13- button : 'Update NPM' ,
1412 verify : 'NPM updated to version 3 or later'
1513 } ) ;
1614 } else {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import {store} from '../../_base';
22import * as path from 'path' ;
33import * as fs from 'fs' ;
44import { fileExists } from '../exists' ;
5+ import { canUpdateTutorial } from './update-tutorial' ;
56
67let tutorialError = 'This is an error with the tutorial itself' ;
78
@@ -41,11 +42,15 @@ function _isTutorial(name: string): boolean {
4142 console . log ( `Error with ${ name } : no test runner specified. ${ tutorialError } ` ) ;
4243 return false ;
4344 }
44- let pathToTestRunner = path . join ( window . coderoad . dir , 'node_modules' , packageJson . config . testRunner ) ;
45- // if (!fileExists(pathToTestRunner)) {
46- // console.log(`Error with ${name}: ${packageJson.config.testRunner} test runner not installed`);
47- // return false;
48- // }
45+
46+ let currentTutorialVersion : string = packageJson . dependencies [ name ] || packageJson . devDependencies [ name ] ;
47+ canUpdateTutorial ( name , currentTutorialVersion ) ;
48+
49+ // let pathToTestRunner = path.join(window.coderoad.dir, 'node_modules', packageJson.config.testRunner);
50+ // // if (!fileExists(pathToTestRunner)) {
51+ // // console.log(`Error with ${name}: ${packageJson.config.testRunner} test runner not installed`);
52+ // // return false;
53+ // // }
4954 return true ;
5055}
5156
Original file line number Diff line number Diff line change 1+ import commandLine from '../command-line' ;
2+
3+ export function canUpdateTutorial ( name : string , currentVersion : string ) {
4+ let latestVersion = commandLine ( 'npm' , `outdated ${ name } ` ) ;
5+ console . log ( latestVersion , currentVersion ) ;
6+ }
Original file line number Diff line number Diff line change 9494 " src/services/setup/setup.ts" ,
9595 " src/services/setup/system-checks.ts" ,
9696 " src/services/setup/tutorials.ts" ,
97+ " src/services/setup/update-tutorial.ts" ,
9798 " src/services/write.ts" ,
9899 " src/store/initialState.ts" ,
99100 " src/store/store.ts" ,
You can’t perform that action at this time.
0 commit comments