-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS dependencies auto-install in packaging scripts
- Loading branch information
Antoine Bernard
committed
Sep 18, 2024
1 parent
bf4417f
commit c1d9e72
Showing
4 changed files
with
105 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
###################################################### | ||
# - Try to find npm command | ||
# Once done this will define | ||
# NPM_FOUND - System has npm | ||
# NPM_BINARY - Path to the npm binary file | ||
|
||
###################################################### | ||
find_program(NPM_BINARY npm) | ||
|
||
###################################################### | ||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set NPM_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args(Npm "Cannot find NPM. This is required beause you took the git master branch. Download official tar.gz or disable webview." | ||
NPM_BINARY) | ||
|
||
###################################################### | ||
mark_as_advanced(NPM_BINARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
###################################################### | ||
# PROJECT : MALT # | ||
# VERSION : 1.2.2 # | ||
# DATE : 06/2023 # | ||
# AUTHOR : Valat Sébastien # | ||
# LICENSE : CeCILL-C # | ||
###################################################### | ||
|
||
###################################################### | ||
export PATH=./node_modules/.bin/:$PATH | ||
SOURCE_DIR=$PWD | ||
|
||
###################################################### | ||
if [ ! -z "$1" ] | ||
then | ||
cp bower.json "$1" | ||
cd "$1" | ||
fi | ||
|
||
###################################################### | ||
if ! which npm | ||
then | ||
echo "Nodejs 'npm' command required to fetch the webview client dependencies, please install 'nodejs' before proceeding or download a release archive instead of using master branch" | ||
exit 1 | ||
fi | ||
|
||
###################################################### | ||
#Workaround on debian:jessie and ubuntu:16.X which rename | ||
#node executable as nodejs which break bower | ||
if ! which node | ||
then | ||
if which nodejs | ||
then | ||
echo "Create NodeJS -> Node fix for ubuntu/debian !" | ||
mkdir -p ./node_modules/.bin/ | ||
ln -s $(which nodejs) ./node_modules/.bin/node | ||
else | ||
echo "You should install NodeJS to fetch web GUI components" | ||
echo "Or download a release archive as it already contains all those files" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
###################################################### | ||
set -e | ||
set -x | ||
npm ci | ||
rm -f ./node_modules/.bin/node | ||
set +x | ||
if [ ! -z "$1" ]; then | ||
echo > deps-loaded | ||
fi | ||
|