summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/envstore13
-rwxr-xr-xtest/main12
2 files changed, 14 insertions, 11 deletions
diff --git a/bin/envstore b/bin/envstore
index f0b7b98..42284a0 100755
--- a/bin/envstore
+++ b/bin/envstore
@@ -7,7 +7,7 @@ use warnings;
use Pod::Usage;
use Storable 'nstore', 'retrieve';
-my $store_file = "/tmp/envstore-$>";
+my $store_file = $ENV{ENVSTORE_FILE} || "/tmp/envstore-$>";
my %store;
my $action = shift;
my $arg = shift;
@@ -131,6 +131,17 @@ Remove I<variable> from store
=back
+=head1 ENVIRONMENT
+
+=over
+
+=item B<ENVSTORE_FILE>
+
+The file in which the environment parameters are stored. By default
+F</tmp/envstore-$UID>
+
+=back
+
=head1 AUTHOR
B<envstore> was written by Daniel Friesel E<lt>derf@derf.homelinux.orgE<gt>
diff --git a/test/main b/test/main
index dae8878..a344379 100755
--- a/test/main
+++ b/test/main
@@ -13,8 +13,8 @@ while [[ $1 == --* ]] {
}
typeset envstore=${1-bin/envstore}
-typeset store_file=${2-/tmp/envstore-$UID}
-typeset backup_file="/tmp/envstore-backup-$UID"
+typeset store_file="/tmp/envstore-test-$UID"
+export ENVSTORE_FILE=$store_file
trap "print -P '\n%N:%i: %B%F{red}Test faild!%F{default}%b'" ZERR
trap "$envstore clear" INT
@@ -34,10 +34,6 @@ if ((help)) {
exit 0
}
-if [[ -e $store_file ]] {
- mv $store_file $backup_file
-}
-
echo "# Documentation"
podchecker -warnings -warnings man/*/*
@@ -155,7 +151,3 @@ if ((test_security)) {
}
print -P '\n%F{green}Test passed%F{default}'
-
-if [[ -e $backup_file ]] {
- mv $backup_file $store_file
-}