mirror of
https://github.com/cjo4m06/mcp-shrimp-task-manager.git
synced 2025-07-26 07:52:25 +08:00
更新 package.json 中的 build 腳本以添加 shebang,並新增 scripts/add-shebang.js 腳本以確保 dist/index.js 文件中包含正確的 shebang。
This commit is contained in:
parent
6f3d2211ac
commit
607b9c9bab
@ -16,7 +16,7 @@
|
|||||||
"shrimp-task-manager": "./dist/index.js"
|
"shrimp-task-manager": "./dist/index.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc && node scripts/add-shebang.js",
|
||||||
"dev": "ts-node src/index.ts",
|
"dev": "ts-node src/index.ts",
|
||||||
"start": "node dist/index.js",
|
"start": "node dist/index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
12
scripts/add-shebang.js
Normal file
12
scripts/add-shebang.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import fs from "fs";
|
||||||
|
const filePath = "./dist/index.js";
|
||||||
|
const shebang = "#!/usr/bin/env node\n";
|
||||||
|
|
||||||
|
let content = fs.readFileSync(filePath, "utf8");
|
||||||
|
if (!content.startsWith(shebang)) {
|
||||||
|
content = shebang + content;
|
||||||
|
fs.writeFileSync(filePath, content);
|
||||||
|
console.log("✅ Shebang added to dist/index.js");
|
||||||
|
} else {
|
||||||
|
console.log("ℹ️ Shebang already present.");
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user