Skip to content

Commit

Permalink
Merge pull request umijs#644 from umijs/fix/local-state-detect-in-yarn
Browse files Browse the repository at this point in the history
fix(umi): local debug state for umi -v is wrong if it's installed via yarn
  • Loading branch information
sorrycc authored Jun 20, 2018
2 parents f2d18b9 + c1e4dce commit 2907928
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 deletions.
1 change: 1 addition & 0 deletions packages/umi/.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Used in bin/umi.js to determine if it is in the local debug state.
5 changes: 3 additions & 2 deletions packages/umi/bin/umi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

const spawn = require('cross-spawn');
const chalk = require('chalk');
const { join } = require('path');
const { existsSync } = require('fs');

const script = process.argv[2];
const args = process.argv.slice(3);
Expand Down Expand Up @@ -43,8 +45,7 @@ switch (aliasedScript) {
case '-v':
case '--version':
console.log(pkg.version);
// TODO: support yarn
if (!(pkg._from && pkg._resolved)) {
if (existsSync(join(__dirname, '../.local'))) {
console.log(chalk.cyan('@local'));
}
break;
Expand Down
3 changes: 0 additions & 3 deletions packages/umi/template/page.css

This file was deleted.

22 changes: 0 additions & 22 deletions packages/umi/template/page.js

This file was deleted.

0 comments on commit 2907928

Please sign in to comment.