Skip to content

Commit b246470

Browse files
fix: use jss binary in PATH with enhanced node_modules/.bin lookup
1 parent f8b0ff7 commit b246470

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { spawn } from 'child_process';
99
import { fileURLToPath } from 'url';
10-
import { dirname, join } from 'path';
10+
import { dirname, join, delimiter } from 'path';
1111
import chalk from 'chalk';
1212
import { existsSync, mkdirSync } from 'fs';
1313

@@ -118,9 +118,6 @@ console.log(chalk.cyan(' └─ ') + chalk.white('WebID: ') + chalk.blue.
118118
console.log('\n' + chalk.dim('Press ') + chalk.bold.red('Ctrl+C') + chalk.dim(' to stop the server\n'));
119119
console.log(chalk.yellow('⏳ Initializing server components...\n'));
120120

121-
// Find jss binary
122-
const jssBin = join(__dirname, 'node_modules', '.bin', 'jss');
123-
124121
// Build jss arguments
125122
const jssArgs = [
126123
'start',
@@ -135,11 +132,12 @@ if (!options.multiuser) {
135132
jssArgs.push('--no-multiuser');
136133
}
137134

138-
// Start JSS
139-
const jss = spawn(jssBin, jssArgs, {
135+
// Start JSS with enhanced PATH to find the binary
136+
const jss = spawn('jss', jssArgs, {
140137
stdio: 'inherit',
141138
env: {
142139
...process.env,
140+
PATH: `${join(__dirname, 'node_modules', '.bin')}${delimiter}${process.env.PATH}`,
143141
TOKEN_SECRET: process.env.TOKEN_SECRET || 'jssd-default-secret-change-in-production',
144142
NODE_ENV: process.env.NODE_ENV || 'development'
145143
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspod",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "JavaScript Solid Pod - Just works, batteries included",
55
"type": "module",
66
"main": "index.js",

0 commit comments

Comments
 (0)