purescript-axon/scripts/common.js
Orion Kindel 15e15aa921
fmt
2024-12-01 17:14:19 -06:00

21 lines
533 B
JavaScript

import Fs from 'fs/promises'
import Path from 'path'
export const rootDir = Path.resolve(__dirname, '..')
export const packageDirs = async () => ['./src', './test']
export const packageSources = async () => {
const packages = await packageDirs()
const sources = []
for (const p of packages) {
const files = await Fs.readdir(p, { recursive: true, withFileTypes: true })
sources.push(
...files.flatMap(e =>
e.isFile() ? [Path.resolve(rootDir, e.path, e.name)] : [],
),
)
}
return sources
}