|
236 | 236 | { name: 'system_disk', desc: 'Get disk usage %', inputs: ['path', 'var'], outputs: ['exec'], color: '#0ea5e9', defaultValues: {path: '"C:\\\\"', var: 'diskUsage'} } |
237 | 237 | ], |
238 | 238 | 'PATH Management': [ |
239 | | - { name: 'path_add', desc: 'Add to system PATH', inputs: ['path', 'scope'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"C:\\\\MyApp"', scope: '--user'} }, |
240 | | - { name: 'path_remove', desc: 'Remove from PATH', inputs: ['path', 'scope'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"C:\\\\MyApp"', scope: '--user'} }, |
241 | | - { name: 'script_path_add', desc: 'Add to script path', inputs: ['path'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"./libs"'} }, |
242 | | - { name: 'script_path_remove', desc: 'Remove from script path', inputs: ['path'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"./libs"'} } |
| 239 | + { name: 'path add', desc: 'Add to system PATH', inputs: ['path', 'scope'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"C:\\\\MyApp"', scope: ''} }, |
| 240 | + { name: 'path remove', desc: 'Remove from PATH', inputs: ['path', 'scope'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"C:\\\\MyApp"', scope: ''} }, |
| 241 | + { name: 'script_path add', desc: 'Add to script path', inputs: ['path'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"./libs"'} }, |
| 242 | + { name: 'script_path remove', desc: 'Remove from script path', inputs: ['path'], outputs: ['exec'], color: '#f59e0b', defaultValues: {path: '"./libs"'} } |
243 | 243 | ], |
244 | 244 | 'Networking': [ |
245 | 245 | { name: 'download', desc: 'Download file from URL', inputs: ['url', 'path'], outputs: ['exec'], color: '#0ea5e9', defaultValues: {url: '"https://example.com/file.zip"', path: '"download.zip"'} }, |
|
1141 | 1141 | const dest = (node.inputs && node.inputs.dest) ? node.inputs.dest : '"extracted"'; |
1142 | 1142 | line = `unzip ${zipfile} to ${dest}`; |
1143 | 1143 |
|
| 1144 | + } else if (node.type === 'path add') { |
| 1145 | + // path add [--system] "path" |
| 1146 | + const path = (node.inputs && node.inputs.path) ? node.inputs.path : '"C:/MyApp"'; |
| 1147 | + const scope = (node.inputs && node.inputs.scope) ? node.inputs.scope.trim() : ''; |
| 1148 | + if (scope && scope.startsWith('--')) { |
| 1149 | + line = `path add ${scope} ${path}`; |
| 1150 | + } else { |
| 1151 | + line = `path add ${path}`; |
| 1152 | + } |
| 1153 | + |
| 1154 | + } else if (node.type === 'path remove') { |
| 1155 | + // path remove [--system] "path" |
| 1156 | + const path = (node.inputs && node.inputs.path) ? node.inputs.path : '"C:/MyApp"'; |
| 1157 | + const scope = (node.inputs && node.inputs.scope) ? node.inputs.scope.trim() : ''; |
| 1158 | + if (scope && scope.startsWith('--')) { |
| 1159 | + line = `path remove ${scope} ${path}`; |
| 1160 | + } else { |
| 1161 | + line = `path remove ${path}`; |
| 1162 | + } |
| 1163 | + |
| 1164 | + } else if (node.type === 'script_path add') { |
| 1165 | + // script_path add "path" |
| 1166 | + const path = (node.inputs && node.inputs.path) ? node.inputs.path : '"./libs"'; |
| 1167 | + line = `script_path add ${path}`; |
| 1168 | + |
| 1169 | + } else if (node.type === 'script_path remove') { |
| 1170 | + // script_path remove "path" |
| 1171 | + const path = (node.inputs && node.inputs.path) ? node.inputs.path : '"./libs"'; |
| 1172 | + line = `script_path remove ${path}`; |
| 1173 | + |
1144 | 1174 | } else { |
1145 | 1175 | // Build argument list from inputs (default handler) |
1146 | 1176 | const args = []; |
|
0 commit comments