Make path to wino containers user-definable

This commit is contained in:
Anna Rose 2010-06-12 17:15:18 -04:00
parent 5032c6d146
commit 2138403d5e

30
wino
View File

@ -2,14 +2,22 @@
#
# wino v git
#
# WINO (WINO is not an organizer is a simple script to help
# WINO (WINO is not an organizer) is a simple script to help
# organize your wine installation into separate WINEPREFIX directories.
# This allows you to have multiple wine "containers", or virtual Windows
# installations, that are separated from each other.
# See 'wino --help' for information on available options
use strict;
use File::Path qw(make_path);
### User-editable fields go here
# The WINO_DIR is the directory wino will store all of its containers
# Do not include a / at the end of this, or things could break...
my $WINO_DIR = '~/.wino';
### No more user-editable data below
my $VERSION = "git";
my $HELP_MSG = "wino v $VERSION\n\tusage: wino --list | <prefix> [options] [command]\n\n" .
@ -28,20 +36,22 @@ my $prefix = shift @ARGV;
my $command = shift @ARGV;
# Check for .wino, make it if needed
if (! -d '~/.wino') { mkdir '~/.wino'; }
# Handle WINO_DIR having a ~
$WINO_DIR =~ s/~/$ENV{'HOME'}/;
# Check for WINO_DIR, make it if needed
unless (-d $WINO_DIR) { make_path $WINO_DIR; }
# We separate out the check for --list, since it uses $prefix and doesn't operate on a
# container
# We separate out the check for --list, since it uses $prefix and doesn't operate on a container
if ($prefix eq '--list')
{
print "Wino Containers:\n";
# List the installed wino containers
foreach (`ls -1d ~/.wino/*`)
foreach (`ls -1 $WINO_DIR`)
{
s/^.*\.wino\///;
s/^.*$WINO_DIR\///;
print;
}
exit;
@ -49,7 +59,7 @@ if ($prefix eq '--list')
# Set the container path
my $container_path = "$ENV{'HOME'}/.wino/$prefix";
my $container_path = "$WINO_DIR/$prefix";