@cerema/cadriciel 1.3.2 → 1.3.4
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/cli.js +11 -7
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -46,17 +46,21 @@ function findCadricielDir(startPath) {
|
|
|
46
46
|
const loadGlobalCommands = () => {
|
|
47
47
|
let dir = fs.readdirSync(__dirname + '/cli/global');
|
|
48
48
|
for (let i = 0; i < dir.length; i++) {
|
|
49
|
-
|
|
50
|
-
'
|
|
51
|
-
|
|
49
|
+
if (dir[i].indexOf('.js') > -1)
|
|
50
|
+
CADRICIEL_GLOBAL_COMMANDS[dir[i].split('.')[0]] = require(__dirname +
|
|
51
|
+
'/cli/global/' +
|
|
52
|
+
dir[i])();
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
const loadCadricielCommands = (path) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
try {
|
|
58
|
+
let dir = fs.readdirSync(path);
|
|
59
|
+
for (let i = 0; i < dir.length; i++) {
|
|
60
|
+
if (dir[i].indexOf('.js') > -1)
|
|
61
|
+
CADRICIEL_COMMANDS[dir[i].split('.')[0]] = require(path + dir[i])();
|
|
62
|
+
}
|
|
63
|
+
} catch (e) {}
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
const label = (caption) => {
|