Skip to content

Commit

Permalink
fix: check for old version of the CLI on empty project
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeryVS authored and filipesilva committed Oct 7, 2016
1 parent 8a5b265 commit 2b6bfe7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/angular-cli/upgrade/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ export class Version {


const configPath = CliConfig.configFilePath();

if (configPath === null) {
return new Version(null);
}

const configJson = readFileSync(configPath, 'utf8');

try {
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/tests/misc/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {deleteFile} from '../../utils/fs';
import {ng} from '../../utils/process';


export default function() {
return ng('version')
.then(() => deleteFile('angular-cli.json'))
// doesn't fail on a project with missing angular-cli.json
.then(() => ng('version'));
}

0 comments on commit 2b6bfe7

Please sign in to comment.