Commit e128fcd
feat: add workdir option to run commands
Add --workdir option to ll-builder and ll-cli run commands to specify
working directory inside the application container
1. Add workdir field to RunCommandOptions and RunOptions structs
2. Update Builder::run method to accept workdir parameter and set
process.cwd
3. Update Cli::run method to handle workdir option and validate absolute
path
4. Add CLI option parsing for --workdir in both ll-builder and ll-cli
5. Validate that workdir path is absolute before setting in container
process
6. Maintain backward compatibility with empty workdir (default behavior)
Log: Added --workdir option to specify working directory inside
container when running applications
Influence:
1. Test ll-builder run --workdir=/path/to/dir with absolute paths
2. Test ll-cli run <app> --workdir=/path/to/dir with absolute paths
3. Verify error handling when providing relative paths
4. Test empty workdir to ensure default behavior unchanged
5. Test with various commands and modules to ensure workdir is properly
set
6. Verify workdir persists through command execution within container
feat: 为运行命令添加工作目录选项
为 ll-builder 和 ll-cli 的 run 命令添加 --workdir 选项,用于指定应用程序
容器内的工作目录
1. 在 RunCommandOptions 和 RunOptions 结构体中添加 workdir 字段
2. 更新 Builder::run 方法以接受 workdir 参数并设置 process.cwd
3. 更新 Cli::run 方法以处理 workdir 选项并验证绝对路径
4. 在 ll-builder 和 ll-cli 中添加 CLI 选项解析支持 --workdir
5. 在容器进程中设置工作目录前验证路径是否为绝对路径
6. 保持向后兼容性,空工作目录使用默认行为
Log: 新增 --workdir 选项用于在运行应用程序时指定容器内的工作目录
Influence:
1. 测试 ll-builder run --workdir=/path/to/dir 使用绝对路径
2. 测试 ll-cli run <app> --workdir=/path/to/dir 使用绝对路径
3. 验证提供相对路径时的错误处理
4. 测试空工作目录以确保默认行为不变
5. 使用各种命令和模块测试工作目录是否正确设置
6. 验证工作目录在容器内的命令执行过程中保持不变1 parent fd0b5ca commit e128fcd
7 files changed
Lines changed: 30 additions & 4 deletions
File tree
- apps
- ll-builder/src
- ll-cli/src
- libs/linglong/src/linglong
- builder
- cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
784 | 788 | | |
785 | 789 | | |
786 | 790 | | |
| 791 | + | |
| 792 | + | |
787 | 793 | | |
788 | 794 | | |
789 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1777 | 1777 | | |
1778 | 1778 | | |
1779 | 1779 | | |
| 1780 | + | |
1780 | 1781 | | |
1781 | 1782 | | |
1782 | 1783 | | |
| |||
1950 | 1951 | | |
1951 | 1952 | | |
1952 | 1953 | | |
1953 | | - | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
1954 | 1960 | | |
1955 | 1961 | | |
1956 | 1962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
718 | 728 | | |
719 | | - | |
720 | | - | |
| 729 | + | |
721 | 730 | | |
722 | 731 | | |
723 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
0 commit comments