apn-app-manager 1.11.2 → 1.12.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.
- package/package.json +1 -1
- package/src/actions/cloneAction.js +14 -1
- package/src/index.js +13 -0
- package/src/util.js +15 -0
package/package.json
CHANGED
|
@@ -55,7 +55,20 @@ function promptAdvancedOptions(appZipPath, icfPath, callback) {
|
|
|
55
55
|
mapNamespaces(function () {
|
|
56
56
|
prompt.promptList("Rename database tables?", ["Yes", "No"], function (renameDbTables) {
|
|
57
57
|
options["renameDbTables"] = renameDbTables == "Yes";
|
|
58
|
-
|
|
58
|
+
fileSelect.selectSingleFile(
|
|
59
|
+
"Clone a package of your application? (If so, choose the package which contains a subset of the objects in the main package already chosen, otherwise choose [None])",
|
|
60
|
+
["zip"],
|
|
61
|
+
true,
|
|
62
|
+
function (partialZipPath) {
|
|
63
|
+
if (partialZipPath) {
|
|
64
|
+
util.delFile(cons.tempDir);
|
|
65
|
+
util.unzipDir(partialZipPath, cons.tempDir);
|
|
66
|
+
executeClone(partialZipPath, icfPath, callback);
|
|
67
|
+
} else {
|
|
68
|
+
executeClone(appZipPath, icfPath, callback);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
59
72
|
});
|
|
60
73
|
});
|
|
61
74
|
}
|
package/src/index.js
CHANGED
|
@@ -47,6 +47,8 @@ Object.keys(options.actions).forEach(action => {
|
|
|
47
47
|
if (commander[action]) passedActions.push(action);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
displayNewVersion();
|
|
51
|
+
|
|
50
52
|
if (util.isBlank(passedActions)) {
|
|
51
53
|
prompt.promptList("What would you like to do?", Object.keys(options.actions), function (answer) {
|
|
52
54
|
passedActions.push(answer);
|
|
@@ -81,6 +83,17 @@ function execAction(params) {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
// Informs the user if there is a new version of the plugin available
|
|
87
|
+
function displayNewVersion() {
|
|
88
|
+
let publicVersion = util.outputCmd("npm view apn-app-manager version");
|
|
89
|
+
let thisVersion = util.outputCmd(`node -p "require('./package.json').version"`);
|
|
90
|
+
if (publicVersion != thisVersion && publicVersion.length > 0) {
|
|
91
|
+
util.printWarning(
|
|
92
|
+
`*** New version of apn-app-manager (${publicVersion}) is available.\n *** You are on version ${thisVersion}. Recommend upgrading via \`npm i -g apn-app-manager\`.\n`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
84
97
|
// Utility function to differenciate between debug logging and real logging
|
|
85
98
|
function debug(input) {
|
|
86
99
|
console.log(input);
|
package/src/util.js
CHANGED
|
@@ -217,6 +217,21 @@ module.exports = {
|
|
|
217
217
|
});
|
|
218
218
|
},
|
|
219
219
|
|
|
220
|
+
// Outputs a command-line script
|
|
221
|
+
outputCmd: function (cmd, cwd, args) {
|
|
222
|
+
try {
|
|
223
|
+
let cmdString = cmd;
|
|
224
|
+
if (!isBlank(args)) {
|
|
225
|
+
Object.keys(args).forEach(key => {
|
|
226
|
+
cmdString = `${cmdString} -${key} ${args[key]}`;
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return npmrun.execSync(cmdString, { cwd: cwd, encoding: "utf8", timeout: 2000 }).replace("\n", "");
|
|
230
|
+
} catch {
|
|
231
|
+
return "";
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
|
|
220
235
|
// Converts XML to JSON with a callback function
|
|
221
236
|
xmlFileToJs: function (filePath, callback) {
|
|
222
237
|
const xmlParser = new xml2js.Parser();
|