File tree Expand file tree Collapse file tree 6 files changed +534
-7
lines changed Expand file tree Collapse file tree 6 files changed +534
-7
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ export class RunCommandParser implements SourceParser {
37
37
while ( i < parts . length ) {
38
38
const arg = parts [ i ] ;
39
39
40
- if ( arg . startsWith ( '-' ) ) {
40
+ // If we haven't found the image yet and the argument starts with a dash,
41
+ // it's an option
42
+ if ( ! imageFound && arg . startsWith ( '-' ) ) {
41
43
switch ( arg ) {
42
44
case '-p' :
43
45
case '--publish' :
@@ -66,9 +68,12 @@ export class RunCommandParser implements SourceParser {
66
68
break ;
67
69
68
70
default :
69
- // Skip other options
70
- if ( arg . startsWith ( '--' ) ) {
71
- i ++ ; // Skip the value of the option if it exists
71
+ // Some flags take arguments, some don't
72
+ if ( arg === '--rm' || arg === '-d' || arg === '--detach' ) {
73
+ // These are standalone flags - don't skip anything
74
+ } else if ( i + 1 < parts . length && ! parts [ i + 1 ] . startsWith ( '-' ) ) {
75
+ // This option likely has a value - skip it
76
+ i ++ ;
72
77
}
73
78
}
74
79
} else if ( ! imageFound ) {
@@ -153,12 +158,15 @@ export class RunCommandParser implements SourceParser {
153
158
const parts : string [ ] = [ ] ;
154
159
let current = '' ;
155
160
let inQuotes = false ;
161
+ let quoteChar = '' ;
156
162
157
163
for ( let i = 0 ; i < command . length ; i ++ ) {
158
164
const char = command [ i ] ;
159
165
160
- if ( char === '\'' || char === '"' ) {
166
+ if ( ( char === '\'' || char === '"' ) && ( inQuotes === false || quoteChar === char ) ) {
161
167
inQuotes = ! inQuotes ;
168
+ if ( inQuotes ) quoteChar = char ;
169
+ else quoteChar = '' ;
162
170
continue ;
163
171
}
164
172
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+ services :
3
+ portkey :
4
+ image : portkeyai/gateway:latest
5
+ ports :
6
+ - " 8787:8787"
Original file line number Diff line number Diff line change
1
+ docker run --rm -p 8787:8787 portkeyai/gateway:latest
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { runTest1 } from './test1';
4
4
import { runTest2 } from './test2' ;
5
5
import { runTest3 } from './test3' ;
6
6
import { runTest4 } from './test4' ;
7
+ import { runTest5 } from './test5' ;
7
8
8
9
// Constants for directories
9
10
const OUTPUT_DIR = join ( __dirname , 'output' ) ;
@@ -39,10 +40,14 @@ async function runAllTests() {
39
40
const test3Passed = await runTest3 ( ) ;
40
41
testResults . push ( { testName : 'Test 3: Environment Variable Substitution' , passed : test3Passed } ) ;
41
42
42
- // Run Test 4: Render Translation Only (Schema validation removed )
43
+ // Run Test 4: Render Translation Only (Schema validation)
43
44
const test4Passed = await runTest4 ( ) ;
44
45
testResults . push ( { testName : 'Test 4: Render Translation Only' , passed : test4Passed } ) ;
45
46
47
+ // Run Test 5: Portkey Gateway Port and Image Verification
48
+ const test5Passed = await runTest5 ( ) ;
49
+ testResults . push ( { testName : 'Test 5: Portkey Gateway Port and Image Verification' , passed : test5Passed } ) ;
50
+
46
51
// Print summary
47
52
console . log ( '\n=== Test Summary ===' ) ;
48
53
const passedTests = testResults . filter ( r => r . passed ) ;
You can’t perform that action at this time.
0 commit comments