20 lines
425 B
Plaintext
Executable File
20 lines
425 B
Plaintext
Executable File
#!/usr/bin/env bun
|
|
import { validateBytecode, formatValidationErrors } from "../src/validator"
|
|
|
|
const args = process.argv.slice(2)
|
|
|
|
if (args.length === 0) {
|
|
console.error("Usage: validate <file.reef>")
|
|
process.exit(1)
|
|
}
|
|
|
|
const filePath = args[0]!
|
|
const source = await Bun.file(filePath).text()
|
|
const result = validateBytecode(source)
|
|
|
|
console.log(formatValidationErrors(result))
|
|
|
|
if (!result.valid) {
|
|
process.exit(1)
|
|
}
|