-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-dependencies
executable file
·47 lines (38 loc) · 1.43 KB
/
update-dependencies
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
42
43
44
45
46
47
#!/usr/bin/env nix-shell
#!nix-shell -i bash -I ./nix --packages bash coreutils nix-prefetch-git
set -euo pipefail
scriptdir="$(realpath $(dirname ${BASH_SOURCE[0]}))"
nixdir="$scriptdir/nix"
# "nixpkgs-channels" is a mirror of "nixpkgs" with branches that track release channels
repo=https://github.com/NixOS/nixpkgs-channels.git
# "nixos-unstable" is a branch which points to the latest commit that has passed their CI
rev=${1:-refs/heads/nixos-unstable}
# "nix-prefetch-git" is a tool that downloads and prints information about a git reference
# Notably, it includes a commit sha and content hash
newCommit=$(nix-prefetch-git --url $repo --rev $rev)
# "default.nix" uses this file to pin exact dependencies
echo "$newCommit" > nix/nixpkgs.json
# generate binstubs for cli tools
bin/nix-binstubs \
awscli \
cocoapods \
fastlane \
git-crypt \
git-lfs \
nodePackages.gulp-cli \
nodejs-10_x \
xcpretty \
yarn
# Generate nix files for xcpretty ruby gem
pushd nix/xcpretty
rm Gemfile.lock
nix run -f $nixdir bundler --command bundle install
nix run -f $nixdir bundix --command bundix
popd
# Update cross-workspace tools installed by yarn
yarn add --dev --ignore-workspace-root-check \
eslint@latest \
expo-cli@latest \
prettier@latest
# Update all yarn.lock files
nix run -f $nixdir fd yarn parallel bash --command bash -c "fd -a yarn.lock $scriptdir | xargs -n 1 dirname | parallel -j 1 'cd {} && echo {} && yarn install --force'"