mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
chore(lint): replace ESLint with Oxlint and clear anti-slop findings
This commit is contained in:
1 parent
c6c13335e5
commit
b625acfc0c
1083 files changed
+67089
-80136
No files matched your search
@@ -1,9 +1,5 @@
|
||||
import { readFileSync } from 'fs'
|
||||
|
||||
/**
|
||||
* Returns the source of a top-level `name() { ... }` function from a shell script so tests can run it in isolation.
|
||||
* Throws when the script does not define the function.
|
||||
*/
|
||||
export function extractShellFunction(scriptPath: string, name: string): string {
|
||||
const match = readFileSync(scriptPath, 'utf-8').match(new RegExp(`^${name}\\(\\) \\{\\n[\\s\\S]*?\\n\\}`, 'm'))
|
||||
if (!match) throw new Error(`${name}() not found in ${scriptPath}`)
|
||||
|
||||
Reference in new issue
Block a user