Skip to content

Commit a6cd6d6

Browse files
committed
Add option to change package name
1 parent 0b51238 commit a6cd6d6

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"test:coverage": "jest --coverage",
3636
"report:coverage": "npm run test:coverage && codecov",
3737
"semantic-release": "semantic-release",
38-
"webpack": "webpack && cp package.json dist"
38+
"webpack": "webpack && node scripts/copyPackageJson.js",
39+
"webpack:debug": "PACKAGE_NAME=crusher-debug yarn webpack"
3940
},
4041
"bin": {
4142
"crusher-cli": "./src/bin/index.js"

scripts/copyPackageJson.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const packageJSON = require("../package.json");
5+
6+
if (process.env.PACKAGE_NAME) {
7+
packageJSON.name = process.env.PACKAGE_NAME;
8+
}
9+
10+
if (fs.existsSync("./dist/package.json")) {
11+
fs.unlinkSync("./dist/package.json");
12+
}
13+
14+
fs.writeFileSync("./dist/package.json", JSON.stringify(packageJSON), "utf8");

src/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const RECORDER_MAC_BUILD = `https://github.com/crusherdev/crusher-downloa
1515
export const RECORDER_MAC_ARM64_BUILD = `https://github.com/crusherdev/crusher-downloads/releases/download/v${recorderVersion}/Crusher.Recorder-${recorderVersion}-mac-arm64.zip`;
1616
export const RECORDER_LINUX_BUILd = `https://github.com/crusherdev/crusher-downloads/releases/download/v${recorderVersion}/Crusher.Recorder-${recorderVersion}-linux.zip`;
1717

18-
1918
export const CLOUDFLARED_URL = {
2019
MAC: "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-amd64.tgz",
2120
LINUX: "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64"

0 commit comments

Comments
 (0)