File: entrypoint.sh

package info (click to toggle)
hugo 0.153.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 49,356 kB
  • sloc: javascript: 31,879; ansic: 2,321; xml: 350; makefile: 197; asm: 67; sh: 50
file content (21 lines) | stat: -rwxr-xr-x 671 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# Check if a custom hugo-docker-entrypoint.sh file exists.
if [ -f hugo-docker-entrypoint.sh ]; then
  # Execute the custom entrypoint file.
  sh hugo-docker-entrypoint.sh "$@"
  exit $?
fi

# Check if a package.json file exists.
if [ -f package.json ]; then
  # Check if node_modules exists.
  if [ ! -d node_modules ]; then
    # Install npm packages.
    # Note that we deliberately do not use `npm ci` here, as it would fail if the package-lock.json file is not up-to-date,
    # which would be the case if you run the container with a different OS or architecture than the one used to create the package-lock.json file.
    npm i
  fi
fi

exec "hugo" "$@"