From 7e1173efc5947f5b6dfc0fef66b461e25ba10f91 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Sun, 30 Sep 2007 19:57:45 +0000 Subject: move code in a first_step function --- transfugdrake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'transfugdrake') diff --git a/transfugdrake b/transfugdrake index cb73020..6fa04d0 100755 --- a/transfugdrake +++ b/transfugdrake @@ -65,12 +65,7 @@ my $wiz = wizards->new({ list => \@linux_users, }, ], - post => sub { - @windows_items = transfugdrake::list_windows_items($windows_disk, $windows_user); - @steps = map { $_->[0] } grep { intersection(\@windows_items, $_->[1]) } group_by2(@step_items); - @steps or return 'nothing'; - next_step(); - }, + post => sub { first_step() }, }, files => { name => N("Migrate your Windows documents to your home directory. Documents can be imported by copying them, or they can be shared with the other operating system"), @@ -164,6 +159,12 @@ my $wiz = wizards->new({ $wiz->process($in); +sub first_step() { + @windows_items = transfugdrake::list_windows_items($windows_disk, $windows_user); + @steps = map { $_->[0] } grep { intersection(\@windows_items, $_->[1]) } group_by2(@step_items); + @steps ? next_step() : 'nothing'; +} + sub next_step() { shift(@steps) || 'end' } sub step_import { -- cgit v1.2.1