Skip to content

Commit 8ef0e05

Browse files
chore: added fixes for legacy systems by using npx
1 parent 73fdb88 commit 8ef0e05

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Koha/Plugin/Com/PerplexedTheta/SENUX.pm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,17 @@ sub _is_npm_installed {
270270
return undef;
271271
}
272272

273+
unless ( which('npx') ) {
274+
$self->_throw_error(
275+
{
276+
message => '`npx` not found in PATH',
277+
return_code => 0,
278+
}
279+
);
280+
281+
return undef;
282+
}
283+
273284
return 1;
274285
}
275286

Koha/Plugin/Com/PerplexedTheta/SENUX/static_files/manage_senux.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@ if [[ "${EUID}" -eq 0 ]]; then
55
echo 'Please run as a non-root (or sudo) user.' && exit 1
66
fi
77

8+
export npm_config_prefix="${SCRIPT_DIR}"
89
export npm_config_cache="${SCRIPT_DIR}/node_cache"
910

1011
alias npm="$(which npm)"
11-
alias gulp="${SCRIPT_DIR}/node_modules/gulp/bin/gulp.js"
12+
alias npx="$(which npx)"
1213

1314
cd "${SCRIPT_DIR}"
1415

1516
build_js() {
16-
gulp js || exit 1
17+
npx gulp js || exit 1
1718

1819
return
1920
}
2021

2122
build_sass() {
22-
gulp sass || exit 1
23+
npx gulp sass || exit 1
2324

2425
return
2526
}
@@ -42,6 +43,7 @@ init() {
4243

4344
install() {
4445
mkdir -pv "${SCRIPT_DIR}/node_cache" || exit 1
46+
mkdir -pv "${SCRIPT_DIR}/node_modules" || exit 1
4547
npm install --include=dev || exit 1
4648

4749
return

Koha/Plugin/Com/PerplexedTheta/SENUX/static_files/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"homepage": "https://github.com/PerplexedTheta/senux#readme",
1919
"devDependencies": {
2020
"gulp": "^5.0.0",
21+
"gulp-cli": "^3.0.0",
2122
"gulp-copy": "^5.0.0",
2223
"gulp-minify": "^3.1.0",
2324
"gulp-rename": "^2.0.0",

0 commit comments

Comments
 (0)