install-rynude 1.0.0 ā 1.0.1
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/index.js +23 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -109,6 +109,20 @@ async function run() {
|
|
|
109
109
|
execSync('cmd.exe /c setup-global.bat', { cwd: INSTALL_DIR, stdio: 'ignore' });
|
|
110
110
|
} else {
|
|
111
111
|
execSync('bash setup-global.sh', { cwd: INSTALL_DIR, stdio: 'ignore' });
|
|
112
|
+
|
|
113
|
+
// Auto add to PATH for Mac/Linux
|
|
114
|
+
const bashrcPath = path.join(os.homedir(), '.bashrc');
|
|
115
|
+
const zshrcPath = path.join(os.homedir(), '.zshrc');
|
|
116
|
+
const pathExport = `\nexport PATH="$HOME/.local/bin:$PATH"\n`;
|
|
117
|
+
|
|
118
|
+
if (fs.existsSync(bashrcPath)) {
|
|
119
|
+
const content = fs.readFileSync(bashrcPath, 'utf8');
|
|
120
|
+
if (!content.includes('.local/bin')) fs.appendFileSync(bashrcPath, pathExport);
|
|
121
|
+
}
|
|
122
|
+
if (fs.existsSync(zshrcPath)) {
|
|
123
|
+
const content = fs.readFileSync(zshrcPath, 'utf8');
|
|
124
|
+
if (!content.includes('.local/bin')) fs.appendFileSync(zshrcPath, pathExport);
|
|
125
|
+
}
|
|
112
126
|
}
|
|
113
127
|
globalSpinner.succeed('Global command berhasil diatur.');
|
|
114
128
|
} catch (e) {
|
|
@@ -117,8 +131,15 @@ async function run() {
|
|
|
117
131
|
}
|
|
118
132
|
|
|
119
133
|
console.log(chalk.green.bold('\nš Instalasi Rynude AI Berhasil Selesai!\n'));
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
|
|
135
|
+
if (os.platform() !== 'win32') {
|
|
136
|
+
console.log(chalk.bgYellow.black.bold(' ā ļø PENTING UNTUK MAC/LINUX '));
|
|
137
|
+
console.log(chalk.yellow(`Harap TUTUP terminal ini sepenuhnya (Quit) lalu buka terminal yang baru, agar perintah dikenali.\n`));
|
|
138
|
+
} else {
|
|
139
|
+
console.log(`Sekarang Anda tidak perlu lagi masuk ke folder project untuk menjalankan aplikasi.`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
console.log(`Buka terminal baru dari folder mana saja (misal di Desktop), lalu ketik:`);
|
|
122
143
|
console.log(chalk.magenta.bold(' rynude\n'));
|
|
123
144
|
}
|
|
124
145
|
|