mirror of
https://github.com/whyour/qinglong.git
synced 2026-01-27 10:25:40 +08:00
Improve URL pattern matching and remove redundant checks
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
f3ec352066
commit
fcf0ee619b
|
|
@ -537,12 +537,14 @@ export async function setSystemTimezone(timezone: string): Promise<boolean> {
|
||||||
|
|
||||||
// Helper function to check if a name is a GitHub URL
|
// Helper function to check if a name is a GitHub URL
|
||||||
function isGitHubUrl(name: string): boolean {
|
function isGitHubUrl(name: string): boolean {
|
||||||
return !!name.match(/^(https?:\/\/|git\+)/i);
|
// Support git+https://, git+http://, https://, and http:// URLs
|
||||||
|
// This covers GitHub URLs and other git-compatible repositories
|
||||||
|
return !!name.match(/^(git\+https?:\/\/|https?:\/\/)/i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper function to check if a name is a requirements file
|
// Helper function to check if a name is a requirements file
|
||||||
function isRequirementsFile(name: string): boolean {
|
function isRequirementsFile(name: string): boolean {
|
||||||
return !!name.match(/requirements.*\.(txt|in)$/i) || name === 'requirements.txt';
|
return !!name.match(/requirements.*\.(txt|in)$/i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper function to check if a name is a pyproject.toml file
|
// Helper function to check if a name is a pyproject.toml file
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user