backend-manager 3.2.158 → 3.2.160
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/cli/cli.js +2 -2
- package/src/manager/index.js +9 -2
package/package.json
CHANGED
package/src/cli/cli.js
CHANGED
|
@@ -1299,8 +1299,8 @@ async function cmd_configSet(self, newPath, newValue) {
|
|
|
1299
1299
|
return reject();
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
1302
|
-
// Make sure it
|
|
1303
|
-
if (newPath.match(/[^a-zA-Z0-9.]/)) {
|
|
1302
|
+
// Make sure it's only letters, numbers, periods, and underscores
|
|
1303
|
+
if (newPath.match(/[^a-zA-Z0-9._]/)) {
|
|
1304
1304
|
console.log(chalk.red(`Path contains invalid characters: ${newPath}`));
|
|
1305
1305
|
return reject();
|
|
1306
1306
|
}
|
package/src/manager/index.js
CHANGED
|
@@ -506,17 +506,23 @@ Manager.prototype.storage = function (options) {
|
|
|
506
506
|
options.clear = typeof options.clear === 'undefined' ? true : options.clear;
|
|
507
507
|
options.log = typeof options.log === 'undefined' ? false : options.log;
|
|
508
508
|
|
|
509
|
+
// Set path
|
|
510
|
+
const subfolder = `storage/${self.options.uniqueAppName || 'primary'}/${options.name}`;
|
|
511
|
+
|
|
512
|
+
// Setup lowdb
|
|
509
513
|
const low = require('lowdb');
|
|
510
514
|
const FileSync = require('lowdb/adapters/FileSync');
|
|
511
515
|
const location = options.temporary
|
|
512
|
-
? `${require('os').tmpdir()}
|
|
513
|
-
: `./.data
|
|
516
|
+
? `${require('os').tmpdir()}/${subfolder}.json`
|
|
517
|
+
: `./.data/${subfolder}.json`;
|
|
514
518
|
const adapter = new FileSync(location);
|
|
515
519
|
|
|
520
|
+
// Log
|
|
516
521
|
if (options.log) {
|
|
517
522
|
self.assistant.log('storage(): Location', location);
|
|
518
523
|
}
|
|
519
524
|
|
|
525
|
+
// Clear temporary storage
|
|
520
526
|
if (
|
|
521
527
|
options.temporary
|
|
522
528
|
&& self.assistant.isDevelopment()
|
|
@@ -526,6 +532,7 @@ Manager.prototype.storage = function (options) {
|
|
|
526
532
|
jetpack.remove(location);
|
|
527
533
|
}
|
|
528
534
|
|
|
535
|
+
// Setup options
|
|
529
536
|
options.clearInvalid = typeof options.clearInvalid === 'undefined'
|
|
530
537
|
? true
|
|
531
538
|
: options.clearInvalid;
|