jackboot
Version:
A cross-platform command line tool to create SpringBoot projects
21 lines (17 loc) • 628 B
JavaScript
const path = require('path');
const { spawn, execSync } = require('child_process');
const fs = require('fs');
// 获取脚本所在的绝对路径
const scriptPath = path.join(__dirname, '../scripts/springboot-quickstart.js');
// 确保脚本有执行权限(在类Unix系统上)
if (process.platform !== 'win32') {
try {
fs.chmodSync(scriptPath, '755');
} catch (err) {
console.error('Failed to set execute permission on script:', err);
}
}
// 直接使用 Node.js 执行脚本,这样在 Windows 和 Unix 系统上都能工作
const args = process.argv.slice(2);
require(scriptPath);