Skip to content

Commit cc5c604

Browse files
committed
feat(web-host): add ls and cat commands to exampleCommands
1 parent a4e8969 commit cc5c604

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/web-host/src/utils/exampleCommands.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,20 @@ function man_weather() {
4646
return "man weather";
4747
}
4848

49-
function ls() {
49+
function ls(path?: string) {
50+
if (path) {
51+
return `ls ${path}`;
52+
}
5053
return "ls";
5154
}
5255

56+
function cat(path?: string) {
57+
if (path) {
58+
return `cat ${path}`;
59+
}
60+
return "cat";
61+
}
62+
5363
function weather_Paris() {
5464
return "weather Paris";
5565
}
@@ -87,6 +97,13 @@ export function getExampleCommand() {
8797
echo_$ROOT_$USER,
8898
weather_Paris,
8999
ls,
100+
() => cat("README.md"),
101+
ls,
102+
() => ls("data"),
103+
() => ls("data/processed"),
104+
() => ls("data/processed/2024"),
105+
() => ls("documents"),
106+
() => cat("documents/config.json"),
90107
man_weather,
91108
help,
92109
];

0 commit comments

Comments
 (0)