Merge branch 'wzp'
This commit is contained in:
22
read_prototype.js
Normal file
22
read_prototype.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const process = require('node:process')
|
||||
|
||||
const filePath = process.argv[2]
|
||||
|
||||
if (!filePath) {
|
||||
console.error('Error: 请提供原型文件路径')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const fullPath = path.resolve(filePath)
|
||||
|
||||
if (fs.existsSync(fullPath)) {
|
||||
console.log('=== START PROTOTYPE CONTENT ===')
|
||||
console.log(fs.readFileSync(fullPath, 'utf-8'))
|
||||
console.log('=== END PROTOTYPE CONTENT ===')
|
||||
}
|
||||
else {
|
||||
console.error(`Error: 未找到原型文件 ${fullPath}`)
|
||||
process.exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user