2019-03-01 18:01:33 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
GIT_ROOT=$(git rev-parse --show-toplevel)
|
|
|
|
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
|
|
|
toolversion="${GIT_ROOT}/scripts/toolversion"
|
|
|
|
dir="$SCRIPTPATH"
|
|
|
|
input="${dir}/output/node-packages.json"
|
|
|
|
output_dir="${dir}/output"
|
|
|
|
|
|
|
|
rm -rf $output_dir && mkdir -p $output_dir
|
|
|
|
react_native_cli_required_version=$($toolversion react_native_cli)
|
|
|
|
cat << EOF > $input
|
|
|
|
[
|
2019-04-01 20:07:39 +00:00
|
|
|
{ "react-native-cli": "${react_native_cli_required_version}",
|
|
|
|
"realm": "git+https://github.com/status-im/realm-js.git#heads/v2.20.1" }
|
2019-03-01 18:01:33 +00:00
|
|
|
]
|
|
|
|
EOF
|
|
|
|
|
|
|
|
node_required_version=$($toolversion node)
|
|
|
|
node_major_version=$(echo $node_required_version | cut -d. -f1,1)
|
2019-04-01 20:07:39 +00:00
|
|
|
|
|
|
|
node2nix --nodejs-${node_major_version} -i $input \
|
2019-03-01 18:01:33 +00:00
|
|
|
-o $output_dir/node-packages.nix \
|
|
|
|
-c $output_dir/default.nix \
|
|
|
|
-e $output_dir/node-env.nix
|
|
|
|
rm $input
|