evophp 1.0.22 → 1.0.24
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/helpers.js +5 -4
- package/new-plugin.js +14 -1
- package/package.json +1 -1
package/helpers.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const readline = require('readline');
|
|
4
|
-
const rl = readline.createInterface({
|
|
5
|
-
input: process.stdin,
|
|
6
|
-
output: process.stdout
|
|
7
|
-
});
|
|
8
4
|
|
|
9
5
|
/**
|
|
10
6
|
* Prompt user for input with a message
|
|
@@ -12,6 +8,11 @@ const rl = readline.createInterface({
|
|
|
12
8
|
* @returns {Promise<string>} - Resolves with user input
|
|
13
9
|
*/
|
|
14
10
|
const readLineAsync = (msg) => {
|
|
11
|
+
const rl = readline.createInterface({
|
|
12
|
+
input: process.stdin,
|
|
13
|
+
output: process.stdout
|
|
14
|
+
});
|
|
15
|
+
|
|
15
16
|
return new Promise((resolve) => {
|
|
16
17
|
rl.question(msg, (userRes) => {
|
|
17
18
|
resolve(userRes);
|
package/new-plugin.js
CHANGED
|
@@ -60,7 +60,7 @@ const { readLineAsync, splitPluginName } = require(helpersPath);
|
|
|
60
60
|
|
|
61
61
|
// Clone the newly created repositories
|
|
62
62
|
cloneDir = path.join('EvoJsDev', 'Modules', pluginName);
|
|
63
|
-
await cloneRepository(author, pluginName
|
|
63
|
+
await cloneRepository(author, `${pluginName}.js`, cloneDir);
|
|
64
64
|
|
|
65
65
|
var pluginPrefix = await readLineAsync("Enter Plugin Prefix?");
|
|
66
66
|
while(!test(pluginPrefix, 3)) {
|
|
@@ -246,4 +246,17 @@ const editFile = async (file, data) => {
|
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
})
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const test = (str, maxLength) => {
|
|
252
|
+
str = str.trim().replaceAll(" ", "")
|
|
253
|
+
if(str.length > maxLength) {
|
|
254
|
+
console.error(`Your input cannot be longer than ${maxLength} characters`);
|
|
255
|
+
return false
|
|
256
|
+
}
|
|
257
|
+
if(str.length < 1) {
|
|
258
|
+
console.error(`You have not made any entry`);
|
|
259
|
+
return false
|
|
260
|
+
}
|
|
261
|
+
return str;
|
|
249
262
|
}
|