@@ -8,6 +8,8 @@ import addNullBetweenChars from './add-null-between-chars.js';
8
8
9
9
export default function detectPlatform ( projectPath : string ) {
10
10
const pipfilePath = path . join ( projectPath , 'Pipfile' ) ;
11
+ const pyprojectFilePath = path . join ( projectPath , 'pyproject.toml' ) ;
12
+ const poetryFilePath = path . join ( projectPath , 'poetry' ) ;
11
13
const indexPHPFilePath = path . join ( projectPath , 'index.php' ) ;
12
14
const packageJsonFilePath = path . join ( projectPath , 'package.json' ) ;
13
15
const composeJsonFilePath = path . join ( projectPath , 'composer.json' ) ;
@@ -20,6 +22,8 @@ export default function detectPlatform(projectPath: string) {
20
22
} ) ;
21
23
22
24
const hasPipfilePathFile = existsSync ( pipfilePath ) ;
25
+ const hasPyprojectPathFile = existsSync ( pyprojectFilePath ) ;
26
+ const hasPoetryPathFile = existsSync ( poetryFilePath ) ;
23
27
const hasIndexPHPFile = existsSync ( indexPHPFilePath ) ;
24
28
const hasPackageFile = existsSync ( packageJsonFilePath ) ;
25
29
const hasComposerJsonFile = existsSync ( composeJsonFilePath ) ;
@@ -69,6 +73,10 @@ Please specify your platform with --platform=laravel or docker.`);
69
73
return 'php' ;
70
74
}
71
75
76
+ if ( hasPyprojectPathFile || hasPoetryPathFile ) {
77
+ return 'python' ;
78
+ }
79
+
72
80
if ( hasRequirementsTxtFile ) {
73
81
const requirementsTxt = readFileSync ( requirementsTxtFilePath ) ;
74
82
@@ -89,6 +97,8 @@ Please specify your platform with --platform=laravel or docker.`);
89
97
) {
90
98
return 'flask' ;
91
99
}
100
+
101
+ return 'python' ;
92
102
}
93
103
94
104
if ( hasPipfilePathFile ) {
@@ -101,6 +111,8 @@ Please specify your platform with --platform=laravel or docker.`);
101
111
if ( pipfile . includes ( 'Flask' ) || pipfile . includes ( 'flask' ) ) {
102
112
return 'flask' ;
103
113
}
114
+
115
+ return 'python' ;
104
116
}
105
117
106
118
if ( hasPackageFile && hasDockerFile ) {
0 commit comments