cob-cli 2.18.0 → 2.19.1

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.
@@ -1,5 +1,7 @@
1
1
  const inquirer = require('inquirer');
2
2
  const colors = require('colors');
3
+ const fs = require("fs");
4
+ const path = require('path');
3
5
  const { checkWorkingCopyCleanliness } = require("../task_lists/common_helpers");
4
6
  const { checkVersion } = require("./upgradeRepo");
5
7
 
@@ -60,8 +62,29 @@ function processOption(option) {
60
62
  })
61
63
  } else if(option.customization) {
62
64
  // Final customization options HAVE a 'customization' function, that process the answers, and HAVE one or more questions
63
- return inquirer.prompt(option.questions).then( answers => option.customization(answers) )
65
+ return inquirer.prompt(option.questions).then( answers => {
66
+ option.customization(answers)
67
+ updateCustomizationsVersions(option.short, require('../../package.json').version)
68
+ })
64
69
  }
65
70
 
66
71
  return "Customization option not supported";
72
+ }
73
+
74
+ /* ************************************************************************ */
75
+
76
+ function updateCustomizationsVersions(customizationKey, version) {
77
+ const customizationsVersionsFile = "customizations.json";
78
+ let customizationsVersions
79
+ try {
80
+ customizationsVersions = require(path.resolve(customizationsVersionsFile))
81
+ }
82
+ catch (err) {
83
+ customizationsVersions = {}
84
+ }
85
+ customizationsVersions[customizationKey] = version;
86
+
87
+ fs.writeFile(customizationsVersionsFile, JSON.stringify(customizationsVersions, null, 2), err => {
88
+ if (err) console.log("Error writing " + customizationsVersionsFile + ":", err.message);
89
+ });
67
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.18.0",
3
+ "version": "2.19.1",
4
4
  "description": "A command line utility to help Cult of Bits partners develop with higher speed and reusing common code and best practices.",
5
5
  "preferGlobal": true,
6
6
  "repository": {