git-truck 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __defProps = Object.defineProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-truck",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "private": false,
5
5
  "description": "Visualizing a Git repository",
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "test": "jest --coverage",
11
11
  "clean": "npx rimraf -rf ./parser/dist build public/build",
12
12
  "postinstall": "npx remix setup node",
13
- "build": "cross-env NODE_ENV=production remix build",
13
+ "build": "cross-env NODE_ENV=production remix build && node ./post-build.js",
14
14
  "dev": "cross-env NODE_ENV=development remix build && run-p dev:*",
15
15
  "dev:remix": "cross-env NODE_ENV=development remix watch",
16
16
  "dev:node": "cross-env NODE_ENV=development nodemon ./build/index.js --watch ./build/index.js",
package/post-build.js ADDED
@@ -0,0 +1,14 @@
1
+ const fs = require("fs")
2
+
3
+ const shebang = "#!/usr/bin/env node\n"
4
+ const buildPath = "./build/index.js"
5
+
6
+ const data = fs.readFileSync(buildPath)
7
+ const fd = fs.openSync(buildPath, "w+")
8
+ const insert = Buffer.from(shebang)
9
+ fs.writeSync(fd, insert, 0, insert.length, 0)
10
+ fs.writeSync(fd, data, 0, data.length, insert.length)
11
+ fs.close(fd, (err) => {
12
+ if (err) throw err
13
+ })
14
+ fs.chmodSync(buildPath, "755")