@rancher/create-extension 1.0.4 → 1.0.5

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rancher/create-extension",
3
3
  "description": "Rancher UI Extension generator",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "license": "Apache-2.0",
6
6
  "author": "SUSE",
7
7
  "packageManager": "yarn@4.5.0",
package/update/init CHANGED
@@ -12,7 +12,7 @@ const args = process.argv;
12
12
 
13
13
  args.splice(0, 2);
14
14
 
15
- const res = spawnSync(`${ __dirname }/upgrade`, args, {
15
+ const res = spawnSync(path.join(__dirname, 'upgrade'), args, {
16
16
  cwd: dest,
17
17
  shell: false,
18
18
  stdio: ['ignore', process.stdout, process.stderr],
@@ -31,9 +31,13 @@ rawdata = fs.readFileSync(path.join(baseFolder, 'app', 'package.json'));
31
31
  const latestPackage = JSON.parse(rawdata);
32
32
 
33
33
  // Update dependency versions to match the latest from the creator
34
- Object.keys(latestPackage._pkgs).forEach((key) => {
35
- appPackage.dependencies[key] = latestPackage._pkgs[key];
36
- });
34
+ if ( latestPackage.dependencies ) {
35
+ Object.keys(latestPackage.dependencies).forEach((key) => {
36
+ appPackage.dependencies[key] = latestPackage.dependencies[key];
37
+ });
38
+ } else {
39
+ console.warn('No dependencies found in latestPackage.'); // eslint-disable-line no-console
40
+ }
37
41
 
38
42
  // Add in the webpack resolution
39
43
  appPackage.resolutions = appPackage.resolutions || {};
package/update/upgrade CHANGED
@@ -20,13 +20,13 @@ done
20
20
  # Check for a clean git repository
21
21
  if [ ! -d ".git" ] && [ "${FORCE}" == "false" ]; then
22
22
  echo "Not runnning in a git repository. Re-run with -f to ignore this check"
23
- echo "Note: This action will update yuor files - running in a git repsository will ensure you have visibility over changes made"
23
+ echo "Note: This action will update your files - running in a git repository will ensure you have visibility over changes made"
24
24
  exit 1
25
25
  fi
26
26
 
27
27
  if [[ $(git diff --stat) != '' ]] && [ "${FORCE}" == "false" ]; then
28
28
  echo "Git repository is not clean. Re-run with -f to ignore this check"
29
- echo "Note: This action will update yuor files - running in a clean git repsository will ensure you have visibility over changes made"
29
+ echo "Note: This action will update your files - running in a clean git repository will ensure you have visibility over changes made"
30
30
  exit 1
31
31
  fi
32
32
 
@@ -54,4 +54,4 @@ do
54
54
 
55
55
  cp ${BASE_DIR}/pkg/files/* ${pkg}
56
56
  fi
57
- done
57
+ done