File: should-skip-node

package info (click to toggle)
cockpit 239-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 67,268 kB
  • sloc: javascript: 245,474; ansic: 72,273; python: 23,634; xml: 6,155; sh: 2,919; makefile: 923; sed: 5
file content (30 lines) | stat: -rwxr-xr-x 534 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh -eu

# Print '1' if the building of node/npm-dependent components should be skipped

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
top_srcdir="${srcdir}/.."

(test -f "${top_srcdir}/src/ws/cockpit.service.in") || {
    echo "**Error**: Directory '${top_srcdir}' does not look like the top-level Cockpit directory"
    exit 1
}

case "${1:-}" in
  1)
    echo 1;
    ;;

  0)
    ;;

  '')
    test -d "${top_srcdir}/node_modules" || echo 1
    ;;

  *)
    echo "Invalid value for NO_NPM: $1" >&2
    exit 1
    ;;
esac