-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:mstarongithub/mk-plugin-repo
- Loading branch information
Showing
3 changed files
with
49 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export function getAIscriptVersion(str: string): string | null { | ||
const regex = /^\/\/\/ @ (.*)/m; | ||
const match = str.match(regex); | ||
if (match && match.length > 1) { | ||
return match[1].trim(); | ||
} | ||
return null; | ||
} | ||
|
||
export function getPluginVersion(str: string): string | null { | ||
const regex = /###\s*{\s*.*version:\s*"([^"]*)".*\s*}/s; | ||
const match = str.match(regex); | ||
if (match && match.length > 1) { | ||
return match[1].trim(); | ||
} | ||
return null; | ||
} | ||
|
||
export function getPluginName(str: string): string | null { | ||
const regex = /###\s*{\s*.*name:\s*"([^"]*)".*\s*}/s; | ||
const match = str.match(regex); | ||
if (match && match.length > 1) { | ||
return match[1].trim(); | ||
} | ||
return null; | ||
} | ||
|
||
export function getPluginDesc(str: string): string | null { | ||
const regex = /###\s*{\s*.*description:\s*"([^"]*)".*\s*}/s; | ||
const match = str.match(regex); | ||
if (match && match.length > 1) { | ||
return match[1].trim(); | ||
} | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters