Skip to content

Commit efeca0d

Browse files
Update doscript-visual-ide.html
1 parent c3b2334 commit efeca0d

1 file changed

Lines changed: 34 additions & 4 deletions

File tree

ide/doscript-visual-ide.html

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@
236236
{ name: 'system_disk', desc: 'Get disk usage %', inputs: ['path', 'var'], outputs: ['exec'], color: '#0ea5e9', defaultValues: {path: '"C:\\\\"', var: 'diskUsage'} }
237237
],
238238
'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"'} }
243243
],
244244
'Networking': [
245245
{ 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,6 +1141,36 @@
11411141
const dest = (node.inputs && node.inputs.dest) ? node.inputs.dest : '"extracted"';
11421142
line = `unzip ${zipfile} to ${dest}`;
11431143

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+
11441174
} else {
11451175
// Build argument list from inputs (default handler)
11461176
const args = [];

0 commit comments

Comments
 (0)