forked from coder/coder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyarn_install.sh
More file actions
executable file
·41 lines (34 loc) · 920 Bytes
/
yarn_install.sh
File metadata and controls
executable file
·41 lines (34 loc) · 920 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
#
# Run "yarn install" with flags appropriate to the environment
# (local development vs build system)
#
# Usage: yarn_install.sh [optional extra flags]
set -euo pipefail
# shellcheck source=scripts/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
cdroot
cd site
yarn_flags=(
# Do not execute install scripts
# TODO: check if build works properly with this enabled
# --ignore-scripts
# Check if existing node_modules are valid
# TODO: determine if this is necessary
# --check-files
)
if [[ -n ${CI:-} ]]; then
yarn_flags+=(
# Install dependencies from lockfile, ensuring builds are fully
# reproducible
--frozen-lockfile
# Suppress progress information
--silent
# Disable interactive prompts for build
--non-interactive
)
fi
# Append whatever is specified on the command line
yarn_flags+=("$@")
echo "+ yarn install ${yarn_flags[*]}"
yarn install "${yarn_flags[@]}"