Skip to content

Commit

Permalink
Update usefultools
Browse files Browse the repository at this point in the history
  • Loading branch information
kepbod committed Mar 18, 2012
1 parent 0af2566 commit e0a8c16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tools/autopl.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
use Cwd;

#
# Program Name: autopl.pl
Expand Down Expand Up @@ -78,7 +79,7 @@ sub interactive {
while (1) { # input file pathway
print "Please input perl file pathway:\n";
chomp($opts{p} = <STDIN>);
chomp($opts{p} = `pwd`) if $opts{p} eq '';
$opts{p} = getcwd() if $opts{p} eq '';
if (-d $opts{p} and -w $opts{p}) {
last;
}
Expand Down
5 changes: 3 additions & 2 deletions tools/autopm.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
use Cwd;

#
# Program Name: autopm.pl
Expand Down Expand Up @@ -67,7 +68,7 @@ sub help {
$opts{a} = '' unless defined $opts{a}; # if no $ENV{USER}

# set and check pathway
$opts{p} =`pwd` unless exists $opts{p} and $opts{p} ne '';
$opts{p} = getpwd() unless exists $opts{p} and $opts{p} ne '';
-d $opts{p} and -w $opts{p}
or die "Your pathway is wrong or no write permission! Please check!\n";
$opts{p} =~ s/([^\/]$)/$1\//;
Expand Down Expand Up @@ -101,7 +102,7 @@ sub interactive {
while (1) { # input module pathway
print "Please input module pathway:\n";
chomp($opts{p} = <STDIN>);
chomp($opts{p} = `pwd`) if $opts{p} eq '';
$opts{p} = getcwd() if $opts{p} eq '';
if (-d $opts{p} and -w $opts{p}) {
last;
}
Expand Down
1 change: 0 additions & 1 deletion tools/gitupdate.pl
Expand Up @@ -62,7 +62,6 @@ sub help {
or die "Can't find 'git'! Please check if it's installed correctly!\n";

# run commands
my $pwd = `pwd`;
chdir $opts{p} or die "Can't open $opts{p}! Please check!\n";
# git add
system("git add .") == 0
Expand Down

0 comments on commit e0a8c16

Please sign in to comment.