deploy: current vibn theia state
Made-with: Cursor
This commit is contained in:
60
packages/task/test-resources/.theia/tasks.json
Normal file
60
packages/task/test-resources/.theia/tasks.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
// comment
|
||||
"tasks": [
|
||||
{
|
||||
"label": "test task",
|
||||
"type": "shell",
|
||||
"command": "./task",
|
||||
"args": [
|
||||
"test"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"windows": {
|
||||
"command": "cmd.exe",
|
||||
"args": [
|
||||
"/c",
|
||||
"task.bat",
|
||||
"abc"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "long running test task",
|
||||
"type": "shell",
|
||||
"command": "./task-long-running",
|
||||
"args": [],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"windows": {
|
||||
"command": "cmd.exe",
|
||||
"args": [
|
||||
"/c",
|
||||
"task-long-running.bat",
|
||||
"abc"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "list all files",
|
||||
"type": "shell",
|
||||
"command": "ls",
|
||||
"args": [
|
||||
"-alR",
|
||||
"/"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"windows": {
|
||||
"command": "cmd.exe",
|
||||
"args": [
|
||||
"/c",
|
||||
"dir"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
14
packages/task/test-resources/compare.js
Normal file
14
packages/task/test-resources/compare.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Compares if two arrays contain the same primitive values.
|
||||
*/
|
||||
exports.compareArrayValues = function (a, b) {
|
||||
if (a.length !== b.length) {
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
8
packages/task/test-resources/task
Executable file
8
packages/task/test-resources/task
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $@
|
||||
do
|
||||
sleep 1
|
||||
echo "tasking... $i"
|
||||
done
|
||||
|
||||
8
packages/task/test-resources/task-long-running
Executable file
8
packages/task/test-resources/task-long-running
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in {1..300}
|
||||
do
|
||||
sleep 1
|
||||
echo "tasking... $i"
|
||||
done
|
||||
|
||||
7
packages/task/test-resources/task-long-running-osx
Executable file
7
packages/task/test-resources/task-long-running-osx
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
for i in {1..300}
|
||||
do
|
||||
sleep 1
|
||||
echo "tasking osx... $i"
|
||||
done
|
||||
10
packages/task/test-resources/task-long-running.bat
Normal file
10
packages/task/test-resources/task-long-running.bat
Normal file
@@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
|
||||
@echo off
|
||||
for /l %%x in (1,1,300) do (
|
||||
echo tasking... %%x
|
||||
@REM sleep for ~1s
|
||||
@REM see: https://stackoverflow.com/questions/735285/how-to-wait-in-a-batch-script
|
||||
ping 192.0.2.2 -n 1 -w 1000> nul
|
||||
)
|
||||
echo "done"
|
||||
7
packages/task/test-resources/task-osx
Executable file
7
packages/task/test-resources/task-osx
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
for i in $@
|
||||
do
|
||||
sleep 1
|
||||
echo "tasking osx... $i"
|
||||
done
|
||||
8
packages/task/test-resources/task.bat
Normal file
8
packages/task/test-resources/task.bat
Normal file
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
|
||||
for /l %%x in (1,1,3) do (
|
||||
echo tasking... %*
|
||||
@REM sleep for ~1s
|
||||
waitfor nothing /t 1 > nul
|
||||
)
|
||||
echo "done"
|
||||
13
packages/task/test-resources/test-arguments-0.js
Normal file
13
packages/task/test-resources/test-arguments-0.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const {
|
||||
compareArrayValues
|
||||
} = require('./compare')
|
||||
|
||||
const debugHint = process.argv[2]
|
||||
const args = process.argv.slice(3)
|
||||
|
||||
if (compareArrayValues(args, ['a', 'b', 'c'])) {
|
||||
process.exit(0) // OK
|
||||
} else {
|
||||
console.error(debugHint, JSON.stringify(args))
|
||||
process.exit(1) // NOT OK
|
||||
}
|
||||
13
packages/task/test-resources/test-arguments-1.js
Normal file
13
packages/task/test-resources/test-arguments-1.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const {
|
||||
compareArrayValues
|
||||
} = require('./compare')
|
||||
|
||||
const debugHint = process.argv[2]
|
||||
const args = process.argv.slice(3)
|
||||
|
||||
if (compareArrayValues(args, ['a', 'b', ' c'])) {
|
||||
process.exit(0) // OK
|
||||
} else {
|
||||
console.error(debugHint, JSON.stringify(args))
|
||||
process.exit(1) // NOT OK
|
||||
}
|
||||
13
packages/task/test-resources/test-arguments-2.js
Normal file
13
packages/task/test-resources/test-arguments-2.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const {
|
||||
compareArrayValues
|
||||
} = require('./compare')
|
||||
|
||||
const debugHint = process.argv[2]
|
||||
const args = process.argv.slice(3)
|
||||
|
||||
if (compareArrayValues(args, ['a', 'b', 'c"'])) {
|
||||
process.exit(0) // OK
|
||||
} else {
|
||||
console.error(debugHint, JSON.stringify(args))
|
||||
process.exit(1) // NOT OK
|
||||
}
|
||||
Reference in New Issue
Block a user