(filePath: string)
| 35 | const locks = new Map<string, Semaphore.Semaphore>() |
| 36 | |
| 37 | function lock(filePath: string) { |
| 38 | const resolvedFilePath = FSUtil.resolve(filePath) |
| 39 | const hit = locks.get(resolvedFilePath) |
| 40 | if (hit) return hit |
| 41 | |
| 42 | const next = Semaphore.makeUnsafe(1) |
| 43 | locks.set(resolvedFilePath, next) |
| 44 | return next |
| 45 | } |
| 46 | |
| 47 | export const Parameters = Schema.Struct({ |
| 48 | filePath: Schema.String.annotate({ description: "The absolute path to the file to modify" }), |