@farris/cli 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/ci/cli.js +14 -1
  2. package/package.json +1 -1
package/ci/cli.js CHANGED
@@ -10,6 +10,17 @@ const yargs = require('yargs/yargs');
10
10
  const cli = yargs(process.argv.slice(2), process.cwd())
11
11
 
12
12
  cli
13
+ .command(
14
+ 'check',
15
+ 'check file changes from last commit.',
16
+ (yargs) => {
17
+ return yargs;
18
+ },
19
+ (argv) => {
20
+ const project = argv.project;
21
+ checkProjectChanges(project);
22
+ }
23
+ )
13
24
  .command(
14
25
  'prerelease',
15
26
  'Update package prerelease version when package has changed.',
@@ -62,8 +73,10 @@ function checkProjectChanges(projectPath) {
62
73
  const changedFiles = returnValue.stdout.split("\n").filter(Boolean);
63
74
  // 根据文件个数确定是否存在变更
64
75
  const hasChanges = changedFiles.length > 0;
65
- if(hasChanges){
76
+ if (hasChanges) {
66
77
  console.log(`${projectPath} has changed.`)
78
+ } else {
79
+ console.log(`Did not detect any changes from ${projectPath} sence last commit.`)
67
80
  }
68
81
  // 返回检测结果
69
82
  return hasChanges;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farris/cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Farris command line interface",
5
5
  "main": "index.js",
6
6
  "scripts": {