install-rynude 1.0.1 → 1.0.2
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 +12 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -113,16 +113,20 @@ async function run() {
|
|
|
113
113
|
// Auto add to PATH for Mac/Linux
|
|
114
114
|
const bashrcPath = path.join(os.homedir(), '.bashrc');
|
|
115
115
|
const zshrcPath = path.join(os.homedir(), '.zshrc');
|
|
116
|
+
const zprofilePath = path.join(os.homedir(), '.zprofile');
|
|
116
117
|
const pathExport = `\nexport PATH="$HOME/.local/bin:$PATH"\n`;
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
[bashrcPath, zshrcPath, zprofilePath].forEach(profilePath => {
|
|
120
|
+
try {
|
|
121
|
+
fs.ensureFileSync(profilePath);
|
|
122
|
+
const content = fs.readFileSync(profilePath, 'utf8');
|
|
123
|
+
if (!content.includes('.local/bin')) {
|
|
124
|
+
fs.appendFileSync(profilePath, pathExport);
|
|
125
|
+
}
|
|
126
|
+
} catch (err) {
|
|
127
|
+
// ignore if permission denied
|
|
128
|
+
}
|
|
129
|
+
});
|
|
126
130
|
}
|
|
127
131
|
globalSpinner.succeed('Global command berhasil diatur.');
|
|
128
132
|
} catch (e) {
|