Make path to wino containers user-definable
This commit is contained in:
parent
5032c6d146
commit
2138403d5e
30
wino
30
wino
|
@ -2,14 +2,22 @@
|
||||||
#
|
#
|
||||||
# wino v git
|
# 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.
|
# organize your wine installation into separate WINEPREFIX directories.
|
||||||
# This allows you to have multiple wine "containers", or virtual Windows
|
# This allows you to have multiple wine "containers", or virtual Windows
|
||||||
# installations, that are separated from each other.
|
# installations, that are separated from each other.
|
||||||
# See 'wino --help' for information on available options
|
# See 'wino --help' for information on available options
|
||||||
|
|
||||||
|
|
||||||
use strict;
|
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 $VERSION = "git";
|
||||||
my $HELP_MSG = "wino v $VERSION\n\tusage: wino --list | <prefix> [options] [command]\n\n" .
|
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;
|
my $command = shift @ARGV;
|
||||||
|
|
||||||
|
|
||||||
# Check for .wino, make it if needed
|
# Handle WINO_DIR having a ~
|
||||||
if (! -d '~/.wino') { mkdir '~/.wino'; }
|
$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
|
# We separate out the check for --list, since it uses $prefix and doesn't operate on a container
|
||||||
# container
|
|
||||||
if ($prefix eq '--list')
|
if ($prefix eq '--list')
|
||||||
{
|
{
|
||||||
print "Wino Containers:\n";
|
print "Wino Containers:\n";
|
||||||
|
|
||||||
# List the installed wino containers
|
# List the installed wino containers
|
||||||
foreach (`ls -1d ~/.wino/*`)
|
foreach (`ls -1 $WINO_DIR`)
|
||||||
{
|
{
|
||||||
s/^.*\.wino\///;
|
s/^.*$WINO_DIR\///;
|
||||||
print;
|
print;
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
|
@ -49,7 +59,7 @@ if ($prefix eq '--list')
|
||||||
|
|
||||||
|
|
||||||
# Set the container path
|
# Set the container path
|
||||||
my $container_path = "$ENV{'HOME'}/.wino/$prefix";
|
my $container_path = "$WINO_DIR/$prefix";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user