Skip to content

Commit 7d8a8ae

Browse files
committed
Use pkg-bin to detect name of the package binary
1 parent 4da0576 commit 7d8a8ae

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"nodeos-boot-singleUserMount",
2626
"nodeos-cross-toolchain",
2727
"nodeos-nodejs",
28+
"pkg-bin",
2829
"usrbinenv"
2930
],
3031
"testDependencies": [
@@ -41,6 +42,7 @@
4142
"nodeos-boot-singleUserMount": "^0.5.2",
4243
"nodeos-cross-toolchain": "^1.0.0-RC3.1",
4344
"nodeos-nodejs": "^6.9.5-0",
45+
"pkg-bin": "piranna/pkg-bin",
4446
"prebuild": "^6.2.0",
4547
"qemu": "^2.9.0",
4648
"suppose": "^0.6.2",

scripts/build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,18 @@ if [[ ! -d $STEP_DIR ]]; then
104104

105105
eval "$NPMi" -g $SINGLE_USER || exit 24
106106

107-
ln -fs bin/$SINGLE_USER $STEP_DIR/init || exit 25
107+
# Set `/init` to package binary or `server.js` file
108+
(
109+
BIN=bin/`pkg-bin $SINGLE_USER` && \
110+
ls $STEP_DIR/$BIN && \
111+
ln -fs $BIN $STEP_DIR/init
112+
) \
113+
|| (
114+
SERVER=lib/node_modules/$SINGLE_USER/server.js && \
115+
ls $STEP_DIR/$SERVER && \
116+
ln -fs $SERVER $STEP_DIR/init
117+
) \
118+
|| exit 25
108119
) || err $?
109120

110121
INIT=nodeos-boot-singleUser

0 commit comments

Comments
 (0)