-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-dependencies
executable file
·45 lines (38 loc) · 1.21 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
#!/usr/bin/env nix-shell
#!nix-shell -i zsh -I ./nix --packages fd parallel zsh coreutils nix-prefetch-git
set -euo pipefail
# "nixpkgs-channels" is a mirror of "nixpkgs" with branches that track release channels
repo=https://github.com/NixOS/nixpkgs-channels.git
rev=${1:-refs/heads/nixpkgs-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 \
jq \
nodePackages.gulp-cli \
nodejs \
xcpretty \
yarn
# Generate lockfile and nix file for ruby gems
for gem in fastlane; do
pushd nix/$gem
rm Gemfile.lock
nix run -f ./.. bundix --command bundix --magic
popd
done
# 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
fd -a yarn.lock -E react-native-lab . \
| parallel -j 1 'cd {//} && echo {//} && yarn install --force'