mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
Use shellwords for nix-shell shebang
Previously we can't have quoted arguments. This now allows us to use things like `ghcWithPackages`
This commit is contained in:
parent
d1e3bf01bc
commit
9018deab6c
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ use Nix::Config;
|
||||||
use Nix::Store;
|
use Nix::Store;
|
||||||
use Nix::Utils;
|
use Nix::Utils;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
|
use Text::ParseWords;
|
||||||
use Cwd;
|
use Cwd;
|
||||||
|
|
||||||
binmode STDERR, ":encoding(utf8)";
|
binmode STDERR, ":encoding(utf8)";
|
||||||
|
@ -56,7 +57,7 @@ if ($runEnv && defined $ARGV[0] && $ARGV[0] !~ /nix-shell/) {
|
||||||
while (<SCRIPT>) {
|
while (<SCRIPT>) {
|
||||||
chomp;
|
chomp;
|
||||||
if (/^\#\!\s*nix-shell (.*)$/) {
|
if (/^\#\!\s*nix-shell (.*)$/) {
|
||||||
push @ARGV, split(/ /, $1);
|
push @ARGV, shellwords(/ /, $1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue