install-rynude 1.0.4 → 1.0.6

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.
Files changed (2) hide show
  1. package/index.js +26 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -11,16 +11,33 @@ const REPO_URL = 'https://github.com/flustratech-dev/rynude_ai.git';
11
11
  const INSTALL_DIR = path.join(os.homedir(), '.rynude_ai');
12
12
 
13
13
  async function checkRequirements() {
14
- const reqs = ['git', 'php', 'composer', 'npm'];
14
+ const reqs = [
15
+ { cmd: 'php', name: 'PHP', download: 'https://windows.php.net/download/' },
16
+ { cmd: 'composer', name: 'Composer', download: 'https://getcomposer.org/Composer-Setup.exe' },
17
+ { cmd: 'git', name: 'Git', download: 'https://git-scm.com/downloads' },
18
+ { cmd: 'npm', name: 'Node.js/NPM', download: 'https://nodejs.org/' }
19
+ ];
20
+
21
+ let hasMissing = false;
22
+ let statusMessage = '\n';
23
+
15
24
  for (const req of reqs) {
16
25
  try {
17
- execSync(`${req} --version`, { stdio: 'ignore' });
26
+ execSync(`${req.cmd} --version`, { stdio: 'ignore' });
27
+ statusMessage += chalk.green(`[✓] ${req.name} (Ditemukan)\n`);
18
28
  } catch (e) {
19
- console.error(chalk.red(`\n❌ Error: Program '${req}' tidak ditemukan di sistem Anda.`));
20
- console.error(chalk.yellow(`Silakan install ${req} terlebih dahulu sebelum menginstal Rynude AI.\n`));
21
- process.exit(1);
29
+ hasMissing = true;
30
+ statusMessage += chalk.red(`[x] ${req.name} (Tidak Ditemukan) -> Download: ${req.download}\n`);
22
31
  }
23
32
  }
33
+
34
+ if (hasMissing) {
35
+ console.error(chalk.red.bold('\n❌ Instalasi Dihentikan: Komponen Hilang!'));
36
+ console.error(chalk.white('Rynude AI membutuhkan beberapa alat tambahan di komputer Anda:'));
37
+ console.error(statusMessage);
38
+ console.error(chalk.yellow.bold('Silakan install aplikasi yang disilang merah, lalu BUKA TERMINAL/CMD BARU dan ketik ulang "npx install-rynude".\n'));
39
+ process.exit(1);
40
+ }
24
41
  }
25
42
 
26
43
  async function run() {
@@ -100,6 +117,8 @@ async function run() {
100
117
  fs.removeSync(backupDir); // clean up tmp
101
118
 
102
119
  execSync('php artisan migrate --force', { cwd: INSTALL_DIR, stdio: 'ignore' });
120
+ execSync('php artisan db:seed --class=AiModelSeeder --force', { cwd: INSTALL_DIR, stdio: 'ignore' });
121
+ execSync('php artisan optimize:clear', { cwd: INSTALL_DIR, stdio: 'ignore' });
103
122
  envSpinner.succeed('Konfigurasi dan database lama Anda berhasil dipulihkan (Aman!).');
104
123
  } else {
105
124
  // Fresh Install
@@ -110,7 +129,9 @@ async function run() {
110
129
 
111
130
  fs.ensureFileSync(path.join(INSTALL_DIR, 'database', 'database.sqlite'));
112
131
  execSync('php artisan key:generate', { cwd: INSTALL_DIR, stdio: 'ignore' });
132
+ execSync('php artisan storage:link', { cwd: INSTALL_DIR, stdio: 'ignore' });
113
133
  execSync('php artisan migrate:fresh --seed', { cwd: INSTALL_DIR, stdio: 'ignore' });
134
+ execSync('php artisan optimize:clear', { cwd: INSTALL_DIR, stdio: 'ignore' });
114
135
  envSpinner.succeed('Konfigurasi dan database siap.');
115
136
  }
116
137
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "install-rynude",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Auto-installer for Rynude AI",
5
5
  "main": "index.js",
6
6
  "type": "module",