bash: generate files using writeShellScript
This ensures that the generated file is syntactically valid. Issue #2015
This commit is contained in:
parent
794d08a1d8
commit
e9b7d12e06
5 changed files with 19 additions and 28 deletions
|
|
@ -1,4 +0,0 @@
|
|||
# -*- mode: sh -*-
|
||||
|
||||
clear-console
|
||||
|
||||
|
|
@ -16,7 +16,11 @@ with lib;
|
|||
assertFileExists home-files/.bash_logout
|
||||
assertFileContent \
|
||||
home-files/.bash_logout \
|
||||
${./logout-expected.txt}
|
||||
${
|
||||
pkgs.writeShellScript "logout-expected" ''
|
||||
clear-console
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
# -*- mode: sh -*-
|
||||
|
||||
. "/home/hm-user/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
export V1="v1"
|
||||
export V2="v2-v1"
|
||||
|
||||
|
||||
|
|
@ -17,7 +17,16 @@ with lib;
|
|||
assertFileExists home-files/.profile
|
||||
assertFileContent \
|
||||
home-files/.profile \
|
||||
${./session-variables-expected.txt}
|
||||
${
|
||||
pkgs.writeShellScript "session-variables-expected" ''
|
||||
. "/home/hm-user/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
export V1="v1"
|
||||
export V2="v2-v1"
|
||||
|
||||
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue