u2a 3.3.0 → 3.3.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.
package/package.json
CHANGED
package/src/commands/create.js
CHANGED
|
@@ -6,9 +6,11 @@ const { getFavicon, processFavicon } = require('../utils/favicon');
|
|
|
6
6
|
const { APPS_DIR, readDB, writeDB } = require('../utils/config');
|
|
7
7
|
const Logger = require('../utils/logger');
|
|
8
8
|
const os = require('os');
|
|
9
|
+
const { sanitizeInput } = require('../utils/sanitize');
|
|
9
10
|
|
|
10
11
|
const logger = new Logger('create');
|
|
11
12
|
|
|
13
|
+
|
|
12
14
|
function createWindowsShortcut(appInfo) {
|
|
13
15
|
try {
|
|
14
16
|
const { appName, appDir, iconPath } = appInfo;
|
|
@@ -673,8 +675,8 @@ async function createApp(url, options) {
|
|
|
673
675
|
|
|
674
676
|
try {
|
|
675
677
|
url = await normalizeUrl(url);
|
|
676
|
-
const domain = getDomainName(url);
|
|
677
|
-
const appName = options.name || domain;
|
|
678
|
+
const domain = sanitizeInput(getDomainName(url));
|
|
679
|
+
const appName = sanitizeInput(options.name || domain);
|
|
678
680
|
|
|
679
681
|
const db = readDB();
|
|
680
682
|
if (db.hasOwnProperty(appName)) {
|
package/src/commands/remove.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const inquirer = require('inquirer');
|
|
3
|
-
const { normalizeUrl, getDomainName } = require('../utils/url');
|
|
4
3
|
const { readDB, writeDB, APPS_DIR } = require('../utils/config');
|
|
5
4
|
const Logger = require('../utils/logger');
|
|
6
5
|
const { removeAppFromOS } = require('./create');
|
|
7
6
|
const path = require('path');
|
|
7
|
+
const { sanitizeInput } = require('../utils/sanitize');
|
|
8
8
|
|
|
9
9
|
const logger = new Logger('remove');
|
|
10
10
|
|
|
11
|
-
async function
|
|
11
|
+
async function processRemoval(appName) {
|
|
12
12
|
try {
|
|
13
13
|
const db = readDB();
|
|
14
14
|
|
|
@@ -53,6 +53,11 @@ async function removeApp(appName) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
async function removeApp(appName) {
|
|
57
|
+
const sAppName = sanitizeInput(appName);
|
|
58
|
+
await processRemoval(sAppName);
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
module.exports = {
|
|
57
62
|
removeApp
|
|
58
63
|
};
|