mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 11:36:07 +01:00
tests: only backup ~/.config/nixpkgs
Other files/directories are not modified by the general test setup.
This commit is contained in:
parent
e687e46e2f
commit
0c2f293502
1 changed files with 12 additions and 5 deletions
|
|
@ -28,12 +28,19 @@ if [[ ! -e "$DEFAULT_ACTIVATE_SCRIPT" ]]; then
|
|||
ln -sn "$(readlink -f "$PROFILE_DIRECTORY/activate")" "$DEFAULT_ACTIVATE_SCRIPT"
|
||||
fi
|
||||
|
||||
if [[ ! -d ~/.config.bak ]]; then
|
||||
mv ~/.config ~/.config.bak
|
||||
cp -r ~/.config.bak ~/.config
|
||||
_cleanup() {
|
||||
rm -rf ~/.config/nixpkgs
|
||||
mv ~/.config/nixpkgs.bak ~/.config/nixpkgs
|
||||
}
|
||||
|
||||
trap _cleanup SIGINT SIGTERM SIGKILL
|
||||
|
||||
if [[ ! -d ~/.config/nixpkgs.bak ]]; then
|
||||
mv ~/.config/nixpkgs ~/.config/nixpkgs.bak
|
||||
fi
|
||||
|
||||
mkdir -p ~/.config/nixpkgs
|
||||
|
||||
bats "${SCRIPT_DIR}" --verbose-run --timing --pretty
|
||||
|
||||
rm -rf ~/.config
|
||||
mv ~/.config.bak ~/.config
|
||||
_cleanup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue