natureco-cli 2.2.0 → 2.2.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/package.json +1 -1
- package/src/commands/dashboard.js +1 -1
- package/src/tools/bash.js +4 -1
- package/src/tools/list_dir.js +3 -2
package/package.json
CHANGED
|
@@ -211,7 +211,7 @@ body::before{
|
|
|
211
211
|
<div class="header-bot-name" id="header-bot-name">Nature Bot</div>
|
|
212
212
|
<div class="header-bot-model" id="header-bot-model">NatureCo</div>
|
|
213
213
|
</div>
|
|
214
|
-
<div class="version-badge" id="version-badge">v2.2.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.2.1</div>
|
|
215
215
|
</div>
|
|
216
216
|
<div class="messages" id="messages"></div>
|
|
217
217
|
<div class="input-area">
|
package/src/tools/bash.js
CHANGED
|
@@ -18,8 +18,11 @@ module.exports = {
|
|
|
18
18
|
async execute(params) {
|
|
19
19
|
try {
|
|
20
20
|
// Replace /home with actual home directory
|
|
21
|
+
// Handles: /home, /home/Documents, /home/anything
|
|
21
22
|
let command = params.command;
|
|
22
|
-
command = command.replace(/\/home(
|
|
23
|
+
command = command.replace(/\/home(\/[^\s]*)?/g, (match, subpath) => {
|
|
24
|
+
return os.homedir() + (subpath || '');
|
|
25
|
+
});
|
|
23
26
|
|
|
24
27
|
const output = execSync(command, {
|
|
25
28
|
encoding: 'utf-8',
|
package/src/tools/list_dir.js
CHANGED
|
@@ -28,8 +28,9 @@ module.exports = {
|
|
|
28
28
|
dirPath = dirPath.replace(/^~/, os.homedir());
|
|
29
29
|
|
|
30
30
|
// Fix /home path - replace with actual home directory
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Handles: /home, home, /home/Documents, /home/anything
|
|
32
|
+
if (dirPath === '/home' || dirPath === 'home' || dirPath.startsWith('/home/')) {
|
|
33
|
+
dirPath = dirPath.replace(/^\/home/, os.homedir());
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
const absolutePath = path.resolve(dirPath);
|