about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/kubo/test-repoVersion.nix
blob: 25fd8fcfbf43a520120f4f71894f303be2e1cf1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
{ runCommand, kubo }:

runCommand "kubo-test-repoVersion" { } ''
  export IPFS_PATH="$TMPDIR"
  "${kubo}/bin/ipfs" init --empty-repo
  declared_repo_version='${kubo.repoVersion}'
  actual_repo_version="$(cat "$IPFS_PATH/version")"
  if [ "$declared_repo_version" != "$actual_repo_version" ]; then
    echo "kubo.repoVersion is not set correctly. It should be $actual_repo_version but is $declared_repo_version."
    exit 1
  fi
  touch "$out"
''