File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 8383 fi
8484 '' )
8585 + (
86- let fixHint = if builtins . hasContext ( toString materialized )
87- then "To fix run: ${ updateMaterialized } "
88- else "To fix check you are in the right directory and run: ${ generateMaterialized } ${ __head ( __match "/nix/store/[^/]*/(.*)" ( toString materialized ) ) } " ;
86+ let
87+ # When the materialized location is already in the store updateMaterialized
88+ # will not work, but generateMaterialized will. We can use this regex to get
89+ # a good idea of what directory might be (relative to some unknown parent).
90+ # In the regex `[^/]*/?` skips the name of the /nix/store sub directory.
91+ matches = __match "${ builtins . storeDir } /[^/]*/?(.*)" ( toString materialized ) ;
92+ fixHint =
93+ if matches == null
94+ then "To fix run: ${ updateMaterialized } " # Not in store so updateMaterialized may work
95+ else if __head matches == ""
96+ then "To fix run: ${ generateMaterialized } <materialized files location>"
97+ else "To fix check you are in the right directory and run: ${ generateMaterialized } ${ __head matches } " ;
8998 in if materialized != null && ! __pathExists materialized
9099 then ''
91100 echo "Materialized nix used for ${ name } is missing. ${ fixHint } " >> $ERR
You can’t perform that action at this time.
0 commit comments