@carbon/upgrade 10.13.0 → 10.16.0-rc.0

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/package.json +6 -5
  2. package/src/cli.js +12 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/upgrade",
3
3
  "description": "A tool for upgrading Carbon versions",
4
- "version": "10.13.0",
4
+ "version": "10.16.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
7
7
  "carbon-upgrade": "./bin/carbon-upgrade.js"
@@ -33,10 +33,11 @@
33
33
  "chalk": "^4.1.1",
34
34
  "change-case": "^4.1.2",
35
35
  "cross-spawn": "^7.0.3",
36
- "fast-glob": "^3.2.5",
36
+ "fast-glob": "^3.2.7",
37
37
  "fs-extra": "^10.0.0",
38
38
  "inquirer": "^8.1.0",
39
- "jest-diff": "^27.0.2",
39
+ "is-git-clean": "^1.1.0",
40
+ "jest-diff": "^27.4.6",
40
41
  "jscodeshift": "^0.13.0",
41
42
  "lodash.clonedeep": "^4.5.0",
42
43
  "lodash.merge": "^4.6.2",
@@ -45,7 +46,7 @@
45
46
  "yargs": "^17.0.1"
46
47
  },
47
48
  "devDependencies": {
48
- "memfs": "^3.2.2"
49
+ "memfs": "^3.4.0"
49
50
  },
50
- "gitHead": "d6041f75d05916f33380502670a56abf82b45a20"
51
+ "gitHead": "a8bade7e1200220296e8ed13621c7a1a88206f0e"
51
52
  }
package/src/cli.js CHANGED
@@ -8,6 +8,7 @@
8
8
  'use strict';
9
9
 
10
10
  const cli = require('yargs');
11
+ const isGitClean = require('is-git-clean');
11
12
  const packageJson = require('../package.json');
12
13
  const { UpgradeError } = require('./error');
13
14
  const { Migration } = require('./migration');
@@ -67,7 +68,18 @@ async function main({ argv, cwd }) {
67
68
 
68
69
  function run(command) {
69
70
  return async (...args) => {
71
+ // checks git status on pwd, returns true if clean / false if not
72
+ let isClean = isGitClean.sync();
73
+
70
74
  console.log('Thanks for trying out @carbon/upgrade! 🙏');
75
+ console.log('Checking git status...👀');
76
+
77
+ if (!isClean) {
78
+ console.error(
79
+ 'Git directory is not clean. Please stash or commit your changes.'
80
+ );
81
+ process.exit(1);
82
+ }
71
83
 
72
84
  try {
73
85
  await command(...args);