aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/update-lockfile.sh
blob: 22460d14beaeaaf80d4f677eec9c0e63bc7d43a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

make_ignored() {
  if [[ -n $1 ]]; then
    while read -r lang; do
      if [[ $lang != "$1" ]]; then
        printf '%s,' "$lang"
      fi
    done < <(jq -r 'keys[]' lockfile.json)
  fi
}

SKIP_LOCKFILE_UPDATE_FOR_LANGS="$(make_ignored "$1")" \
  nvim --headless -c 'luafile ./scripts/write-lockfile.lua' +q

# Pretty print
cp lockfile.json /tmp/lockfile.json
jq --sort-keys > lockfile.json < /tmp/lockfile.json