Skip to content

Commit

Permalink
Make a realpath tempdir using Path::Tiny directly
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Oct 10, 2016
1 parent c9585a5 commit c8c2749
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions lib/Code/TidyAll/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ use File::Path qw(mkpath);
use File::Slurp::Tiny qw(read_file write_file);

use File::Spec;
use File::Temp qw(tempdir);
use Guard;
use Path::Tiny qw(cwd path);
use Path::Tiny 0.098 qw(cwd path tempdir);
use Try::Tiny;

use Exporter qw(import);
Expand Down Expand Up @@ -48,15 +47,11 @@ sub can_load {
sub tempdir_simple {
my $template = shift || 'Code-TidyAll-XXXX';

# If we use tempdir() from Path::Tiny we cannot easily turn that into a
# realpath because of https://github.com/dagolden/Path-Tiny/issues/183.
return path(
tempdir(
$template,
DIR => File::Spec->tmpdir,
CLEANUP => 1
)
)->realpath;
return tempdir(
{ realpath => 1 },
TEMPLATE => $template,
CLEANUP => 1
);
}

sub pushd {
Expand Down

0 comments on commit c8c2749

Please sign in to comment.