elevate-git

LOW
maintainer zxp19821005 1 votes scanned 2026-11-01 00:21:48.120785
View on AUR
Why flagged

The npm install in prepare() is part of building the project from its own source and uses the official npm registry; the flagged external package install (husky) is a dev dependency added for the build process and does not introduce untrusted remote code execution.

Triggered rules

Low AI review downgraded a static finding llm_review

The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 90%): The npm install in prepare() is part of building the project from its own source and uses the official npm registry; the flagged external package install (husky) is a dev dependency added for the build process and does not introduce untrusted remote code execution.

1 higher static finding superseded - not the current verdict (shown for transparency)
Medium npm/yarn/pnpm install of an undeclared external package npm_install_external

Runs `npm/yarn/pnpm install <package>` for a package not in source=(), pulling unpinned, unreviewed code at build time. Severity downgraded: the package declares/looks like a Node.js consumer, where build-time installs are expected.

  • PKGBUILD:91 npm add -D husky

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2pkgname=elevate-git
3pkgver=7.2.2.r3.gdf9e2ce
4_electronversion=27
5_nodeversion=18
6pkgrel=1
7pkgdesc="A sport app to 'Elevate' your training experience and goals! Track your fitness and progressions over time. Analyse deeper your activities. And more..."
8arch=('any')
9url="https://thomaschampagne.github.io/elevate-docs/"
10_ghurl="https://github.com/thomaschampagne/elevate"
11license=('MPL-2.0')
12depends=(
13 "electron${_electronversion}-bin"
14)
15makedepends=(
16 'npm'
17 'git'
18 'nvm'
19 'gendesk'
20 'jq'
21)
22source=(
23 "${pkgname//-/.}::git+${_ghurl}.git"
24 "${pkgname%-git}.sh"
25)
26sha256sums=('SKIP'
27 'dfcd6603d29c7b8d88e019b517a2e5c1a7b5ab905a0961a8b81adfa508b258b8')
28_get_project_dir() {
29 local d
30 while IFS= read -r d; do
31 find "$d" -name "package.json" ! -path "*/node_modules/*" 2>/dev/null | grep -q . && { echo "$d"; return; }
32 done < <(find "${srcdir}" -maxdepth 1 -mindepth 1 -type d ! -name '.*')
33}
34pkgver() {
35 cd "$(_get_project_dir)"
36 set -o pipefail
37 git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
38 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
39}
40_ensure_local_nvm() {
41 local NVM_DIR="${srcdir}/.nvm"
42 source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
43 nvm install "${_nodeversion}"
44 nvm use "${_nodeversion}"
45}
46_get_app_dir() {
47 find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -print 2>/dev/null | while read f; do [ -d "${f%/*}/resources" ] && echo "${f%/*}" && break; done
48}
49_get_electron_version() {
50 _elec_ver=$(find "$(_get_project_dir)" -name "package.json" ! -path "*/node_modules/*" -print \
51 | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null \
52 | grep -oE '[0-9]+' | head -1)
53 [[ -z "${_elec_ver}" ]] && return 1
54 (( _elec_ver == _electronversion )) && c=32 || c=31
55 echo -e "Electron version: \033[1;${c}m${_elec_ver}$([[ $c -eq 31 ]] && echo " (expected ${_electronversion})")\033[0m"
56}
57_set_build_env() {
58 export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
59 export ELECTRON_OVERRIDE_DIST_PATH="${ELECTRON_DIST}"
60 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
61 export ELECTRON_BUILDER_OFFLINE=true
62 export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/^v//')"
63 export HOME="${srcdir}/.home"
64 export XDG_CACHE_HOME="${HOME}/.cache"
65 export XDG_CONFIG_HOME="${HOME}/.config"
66 export XDG_DATA_HOME="${HOME}/.local/share"
67 export npm_config_cache="${HOME}/.npm_cache"
68 export COREPACK_NPM_REGISTRY="${COREPACK_NPM_REGISTRY:-${NPM_CONFIG_REGISTRY:-https://registry.npmjs.org}}"
69 export COREPACK_HOME="${HOME}/.corepack"
70 export npm_config_audit=false
71 export npm_config_registry="${NPM_CONFIG_REGISTRY:-${npm_config_registry:-https://registry.npmjs.org}}"
72 mkdir -p "${HOME}" "${npm_config_cache}" "${COREPACK_HOME}"
73}
74prepare() {
75 cd "$(_get_project_dir)"
76 _get_electron_version
77 sed -i -e "
78 s/@electronversion@/${_electronversion}/g
79 s/@appname@/${pkgname%-git}/g
80 " -i "${srcdir}/${pkgname%-git}.sh"
81 gendesk -q -f -n \
82 --pkgname="${pkgname%-git}" \
83 --pkgdesc="${pkgdesc}" \
84 --categories="Utility" \
85 --name="${pkgname%-git}" \
86 --exec="${pkgname%-git} %U"
87 _ensure_local_nvm
88 _set_build_env
89 jq --arg ver "${SYSTEM_ELECTRON_VERSION}" '.devDependencies.electron = $ver' package.json > package.json.tmp && mv package.json.tmp package.json
90 export NODE_ENV=development
91 npm add -D husky
92 npm install
93}
94build() {
95 cd "$(_get_project_dir)/desktop"
96 _ensure_local_nvm
97 _set_build_env
98 export NODE_ENV=production
99 npm run build:prod
100 npm exec -c "electron-builder build --linux dir -c.electronDist=${ELECTRON_DIST}"
101}
102package() {
103 install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
104 install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
105 rm -rf "$(_get_app_dir)/resources/default_app.asar"
106 cp -a "$(_get_app_dir)/resources/." "${pkgdir}/usr/lib/${pkgname%-git}/"
107 install -Dm644 "$(_get_project_dir)/desktop/res/icons/icon.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${pkgname%-git}.png"
108 install -Dm644 "$(_get_project_dir)/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
109 install -Dm644 "$(_get_project_dir)/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
110}
111

Scan history

Scanned at (UTC)SeverityRules
2026-11-01 00:21:48 Low 2
2026-10-31 00:07:41 Low 2
2026-10-30 00:29:30 Low 2
2026-10-29 00:13:55 Low 2
2026-10-28 00:06:54 Low 2
2026-10-27 00:23:28 Low 2
2026-10-26 00:12:40 Low 2
2026-10-25 00:20:48 Low 2
2026-10-24 00:14:55 Low 2
2026-10-23 00:02:19 Low 2
2026-10-22 00:13:10 Low 2
2026-10-21 00:12:50 Low 2
2026-10-20 00:10:31 Low 2
2026-10-19 00:03:55 Low 2
2026-10-18 00:06:55 Low 2
2026-10-17 00:21:55 Low 2
2026-10-16 00:12:47 Low 2
2026-10-15 00:28:05 Low 2
2026-10-14 00:06:47 Low 2
2026-10-13 11:16:23 Medium 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion