the previous detection of nix sandboxes was incorrectly considering
directories that ended in -nix as a sandbox directory (it was
searching for .nix without escaping the dot).
also, even fixing the regex, if one had a directory ending in
.nix (for example: haskell.nix for IOHK's repo), the parent
directory would be considered the sandbox directory.
therefore, here, we fix the regex to escape the dot and to also reject
directories that end in .nix from the search.
Examples:
The examples below use the following test structure:
the previous detection of nix sandboxes was incorrectly considering directories that ended in
-nix
as a sandbox directory (it was searching for.nix
without escaping the dot).also, even fixing the regex, if one had a directory ending in
.nix
(for example:haskell.nix
for IOHK's repo), the parent directory would be considered the sandbox directory.therefore, here, we fix the regex to escape the dot and to also reject directories that end in
.nix
from the search.Examples:
The examples below use the following test structure:
Results of
(nix-current-sandbox)
"/home/thales/tmp/test-nix-sandbox/"
test.nix
dir:nil
"/home/thales/tmp/test-nix-sandbox/"
nil